Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254995
b: refs/heads/master
c: 0b8f627
h: refs/heads/master
i:
  254993: 94346a2
  254991: 078528f
v: v3
  • Loading branch information
Joe Perches authored and David S. Miller committed Jul 18, 2011
1 parent 7d88a60 commit e414746
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 90 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc6b845044ccb7e9e6f3b7e71bd179b3cf0223b6
refs/heads/master: 0b8f6273eb6fd0611849d6fb432151f04e042434
1 change: 0 additions & 1 deletion trunk/drivers/hwmon/asus_atk0110.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ static int atk_debugfs_gitm_get(void *p, u64 *val)
else
err = -EIO;

ACPI_FREE(ret);
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/hwmon/it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ static struct attribute *it87_attributes_label[] = {
};

static const struct attribute_group it87_group_label = {
.attrs = it87_attributes_label,
.attrs = it87_attributes_vid,
};

/* SuperIO detection - will change isa_address if a chip is found */
Expand Down
11 changes: 0 additions & 11 deletions trunk/drivers/hwmon/max1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ struct max1111_data {
struct spi_transfer xfer[2];
uint8_t *tx_buf;
uint8_t *rx_buf;
struct mutex drvdata_lock;
/* protect msg, xfer and buffers from multiple access */
};

static int max1111_read(struct device *dev, int channel)
Expand All @@ -50,25 +48,19 @@ static int max1111_read(struct device *dev, int channel)
uint8_t v1, v2;
int err;

/* writing to drvdata struct is not thread safe, wait on mutex */
mutex_lock(&data->drvdata_lock);

data->tx_buf[0] = (channel << MAX1111_CTRL_SEL_SH) |
MAX1111_CTRL_PD0 | MAX1111_CTRL_PD1 |
MAX1111_CTRL_SGL | MAX1111_CTRL_UNI | MAX1111_CTRL_STR;

err = spi_sync(data->spi, &data->msg);
if (err < 0) {
dev_err(dev, "spi_sync failed with %d\n", err);
mutex_unlock(&data->drvdata_lock);
return err;
}

v1 = data->rx_buf[0];
v2 = data->rx_buf[1];

mutex_unlock(&data->drvdata_lock);

if ((v1 & 0xc0) || (v2 & 0x3f))
return -EINVAL;

Expand Down Expand Up @@ -184,8 +176,6 @@ static int __devinit max1111_probe(struct spi_device *spi)
if (err)
goto err_free_data;

mutex_init(&data->drvdata_lock);

data->spi = spi;
spi_set_drvdata(spi, data);

Expand Down Expand Up @@ -223,7 +213,6 @@ static int __devexit max1111_remove(struct spi_device *spi)

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group);
mutex_destroy(&data->drvdata_lock);
kfree(data->rx_buf);
kfree(data->tx_buf);
kfree(data);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/radio/si4713-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev,
char ps_name[MAX_RDS_PS_NAME + 1];

len = control->size - 1;
if (len < 0 || len > MAX_RDS_PS_NAME) {
if (len > MAX_RDS_PS_NAME) {
rval = -ERANGE;
goto exit;
}
Expand All @@ -1057,7 +1057,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev,
char radio_text[MAX_RDS_RADIO_TEXT + 1];

len = control->size - 1;
if (len < 0 || len > MAX_RDS_RADIO_TEXT) {
if (len > MAX_RDS_RADIO_TEXT) {
rval = -ERANGE;
goto exit;
}
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/tulip/dmfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,6 @@ static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db)
txptr = db->tx_remove_ptr;
while(db->tx_packet_cnt) {
tdes0 = le32_to_cpu(txptr->tdes0);
pr_debug("tdes0=%x\n", tdes0);
if (tdes0 & 0x80000000)
break;

Expand All @@ -889,7 +888,6 @@ static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db)

/* Transmit statistic counter */
if ( tdes0 != 0x7fffffff ) {
pr_debug("tdes0=%x\n", tdes0);
dev->stats.collisions += (tdes0 >> 3) & 0xf;
dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff;
if (tdes0 & TDES0_ERR_MASK) {
Expand Down Expand Up @@ -986,7 +984,6 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
/* error summary bit check */
if (rdes0 & 0x8000) {
/* This is a error packet */
pr_debug("rdes0: %x\n", rdes0);
dev->stats.rx_errors++;
if (rdes0 & 1)
dev->stats.rx_fifo_errors++;
Expand Down Expand Up @@ -1638,7 +1635,6 @@ static u8 dmfe_sense_speed(struct dmfe_board_info * db)
else /* DM9102/DM9102A */
phy_mode = phy_read(db->ioaddr,
db->phy_addr, 17, db->chip_id) & 0xf000;
pr_debug("Phy_mode %x\n", phy_mode);
switch (phy_mode) {
case 0x1000: db->op_mode = DMFE_10MHF; break;
case 0x2000: db->op_mode = DMFE_10MFD; break;
Expand Down
19 changes: 3 additions & 16 deletions trunk/fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,15 +1438,12 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
struct dentry *temp;
char *path;
int len, pos;
unsigned seq;

if (dentry == NULL)
return ERR_PTR(-EINVAL);

retry:
len = 0;
seq = read_seqbegin(&rename_lock);
rcu_read_lock();
for (temp = dentry; !IS_ROOT(temp);) {
struct inode *inode = temp->d_inode;
if (inode && ceph_snap(inode) == CEPH_SNAPDIR)
Expand All @@ -1458,12 +1455,10 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
len += 1 + temp->d_name.len;
temp = temp->d_parent;
if (temp == NULL) {
rcu_read_unlock();
pr_err("build_path corrupt dentry %p\n", dentry);
return ERR_PTR(-EINVAL);
}
}
rcu_read_unlock();
if (len)
len--; /* no leading '/' */

Expand All @@ -1472,12 +1467,9 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
return ERR_PTR(-ENOMEM);
pos = len;
path[pos] = 0; /* trailing null */
rcu_read_lock();
for (temp = dentry; !IS_ROOT(temp) && pos != 0; ) {
struct inode *inode;
struct inode *inode = temp->d_inode;

spin_lock(&temp->d_lock);
inode = temp->d_inode;
if (inode && ceph_snap(inode) == CEPH_SNAPDIR) {
dout("build_path path+%d: %p SNAPDIR\n",
pos, temp);
Expand All @@ -1486,26 +1478,21 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
break;
} else {
pos -= temp->d_name.len;
if (pos < 0) {
spin_unlock(&temp->d_lock);
if (pos < 0)
break;
}
strncpy(path + pos, temp->d_name.name,
temp->d_name.len);
}
spin_unlock(&temp->d_lock);
if (pos)
path[--pos] = '/';
temp = temp->d_parent;
if (temp == NULL) {
rcu_read_unlock();
pr_err("build_path corrupt dentry\n");
kfree(path);
return ERR_PTR(-EINVAL);
}
}
rcu_read_unlock();
if (pos != 0 || read_seqretry(&rename_lock, seq)) {
if (pos != 0) {
pr_err("build_path did not end path lookup where "
"expected, namelen is %d, pos is %d\n", len, pos);
/* presumably this is only possible if racing with a
Expand Down
13 changes: 1 addition & 12 deletions trunk/fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ build_path_from_dentry(struct dentry *direntry)
char dirsep;
struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb);
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
unsigned seq;

if (direntry == NULL)
return NULL; /* not much we can do if dentry is freed and
Expand All @@ -69,47 +68,37 @@ build_path_from_dentry(struct dentry *direntry)
dfsplen = 0;
cifs_bp_rename_retry:
namelen = dfsplen;
seq = read_seqbegin(&rename_lock);
rcu_read_lock();
for (temp = direntry; !IS_ROOT(temp);) {
namelen += (1 + temp->d_name.len);
temp = temp->d_parent;
if (temp == NULL) {
cERROR(1, "corrupt dentry");
rcu_read_unlock();
return NULL;
}
}
rcu_read_unlock();

full_path = kmalloc(namelen+1, GFP_KERNEL);
if (full_path == NULL)
return full_path;
full_path[namelen] = 0; /* trailing null */
rcu_read_lock();
for (temp = direntry; !IS_ROOT(temp);) {
spin_lock(&temp->d_lock);
namelen -= 1 + temp->d_name.len;
if (namelen < 0) {
spin_unlock(&temp->d_lock);
break;
} else {
full_path[namelen] = dirsep;
strncpy(full_path + namelen + 1, temp->d_name.name,
temp->d_name.len);
cFYI(0, "name: %s", full_path + namelen);
}
spin_unlock(&temp->d_lock);
temp = temp->d_parent;
if (temp == NULL) {
cERROR(1, "corrupt dentry");
rcu_read_unlock();
kfree(full_path);
return NULL;
}
}
rcu_read_unlock();
if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) {
if (namelen != dfsplen) {
cERROR(1, "did not end path lookup where expected namelen is %d",
namelen);
/* presumably this is only possible if racing with a rename
Expand Down
22 changes: 10 additions & 12 deletions trunk/fs/cramfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static DEFINE_MUTEX(read_mutex);
/* These macros may change in future, to provide better st_ino semantics. */
#define OFFSET(x) ((x)->i_ino)

static unsigned long cramino(const struct cramfs_inode *cino, unsigned int offset)
static unsigned long cramino(struct cramfs_inode *cino, unsigned int offset)
{
if (!cino->offset)
return offset + 1;
Expand All @@ -61,7 +61,7 @@ static unsigned long cramino(const struct cramfs_inode *cino, unsigned int offse
}

static struct inode *get_cramfs_inode(struct super_block *sb,
const struct cramfs_inode *cramfs_inode, unsigned int offset)
struct cramfs_inode *cramfs_inode, unsigned int offset)
{
struct inode *inode;
static struct timespec zerotime;
Expand Down Expand Up @@ -317,7 +317,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
/* Set it all up.. */
sb->s_op = &cramfs_ops;
root = get_cramfs_inode(sb, &super.root, 0);
if (IS_ERR(root))
if (!root)
goto out;
sb->s_root = d_alloc_root(root);
if (!sb->s_root) {
Expand Down Expand Up @@ -423,7 +423,6 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
{
unsigned int offset = 0;
struct inode *inode = NULL;
int sorted;

mutex_lock(&read_mutex);
Expand All @@ -450,8 +449,8 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s

for (;;) {
if (!namelen) {
inode = ERR_PTR(-EIO);
goto out;
mutex_unlock(&read_mutex);
return ERR_PTR(-EIO);
}
if (name[namelen-1])
break;
Expand All @@ -463,18 +462,17 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s
if (retval > 0)
continue;
if (!retval) {
inode = get_cramfs_inode(dir->i_sb, de, dir_off);
break;
struct cramfs_inode entry = *de;
mutex_unlock(&read_mutex);
d_add(dentry, get_cramfs_inode(dir->i_sb, &entry, dir_off));
return NULL;
}
/* else (retval < 0) */
if (sorted)
break;
}
out:
mutex_unlock(&read_mutex);
if (IS_ERR(inode))
return ERR_CAST(inode);
d_add(dentry, inode);
d_add(dentry, NULL);
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/exofs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ struct dentry *exofs_get_parent(struct dentry *child)
unsigned long ino = exofs_parent_ino(child);

if (!ino)
return ERR_PTR(-ESTALE);
return NULL;

return d_obtain_alias(exofs_iget(child->d_inode->i_sb, ino));
}
Expand Down
Loading

0 comments on commit e414746

Please sign in to comment.