On Wed, 9 Feb 2005 20:49:36 -0600, Tom Zanussi <[EMAIL PROTECTED]> wrote: > +static int relayfs_create_entry(const char *name, struct dentry *parent, > + int mode, struct rchan *chan, > + struct dentry **dentry) > +{ > + struct qstr qname; > + struct dentry *d; > + struct inode *inode; > + int error = 0; > + > + BUG_ON(!(S_ISREG(mode) || S_ISDIR(mode))); > + > + error = simple_pin_fs("relayfs", &relayfs_mount, > &relayfs_mount_count); > + if (error) { > + printk(KERN_ERR "Couldn't mount relayfs: errcode %d\n", > error); > + return error; > + } > + > + qname.name = name; > + qname.len = strlen(name); > + qname.hash = full_name_hash(name, qname.len); > + > + if (!parent) > + if (relayfs_mount && relayfs_mount->mnt_sb) > + parent = relayfs_mount->mnt_sb->s_root;
Please move the nested if statement to the parent expression. The !parent part is always evaluated first. > +static struct inode *relayfs_alloc_inode(struct super_block *sb) > +{ > + struct relayfs_inode_info *p; > + p = (struct relayfs_inode_info > *)kmem_cache_alloc(relayfs_inode_cachep, > + SLAB_KERNEL); Please drop the spurious cast from void *. Pekka - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/