From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dong Fang Subject: Re: [PATCH 1/3] vfs: fixed some CamelCase coding style issue Date: Mon, 05 Aug 2013 04:16:19 -0400 Message-ID: <51FF5F53.8040004@gmail.com> References: <1375239002-14856-1-git-send-email-yp.fangdong@gmail.com> <1375239002-14856-2-git-send-email-yp.fangdong@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: viro@zeniv.linux.org.uk, miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, fuse-devel@lists.sourceforge.net, Dan Carpenter To: Dong Fang Return-path: Received: from mail-pa0-f49.google.com ([209.85.220.49]:42847 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753984Ab3HEAQz (ORCPT ); Sun, 4 Aug 2013 20:16:55 -0400 Received: by mail-pa0-f49.google.com with SMTP id bi5so2641996pad.22 for ; Sun, 04 Aug 2013 17:16:55 -0700 (PDT) In-Reply-To: <1375239002-14856-2-git-send-email-yp.fangdong@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07/30/2013 10:50 PM, Dong Fang wrote: > --- > fs/binfmt_misc.c | 39 ++++++++++++++++++++------------------- > 1 files changed, 20 insertions(+), 19 deletions(-) > > diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c > index 1c740e1..e02b857 100644 > --- a/fs/binfmt_misc.c > +++ b/fs/binfmt_misc.c > @@ -45,7 +45,7 @@ enum {Enabled, Magic}; > #define MISC_FMT_OPEN_BINARY (1<<30) > #define MISC_FMT_CREDENTIALS (1<<29) > > -typedef struct { > +struct bm_node { > struct list_head list; > unsigned long flags; /* type, status, etc. */ > int offset; /* offset of magic */ > @@ -55,7 +55,7 @@ typedef struct { > char *interpreter; /* filename of interpreter */ > char *name; > struct dentry *dentry; > -} Node; > +}; > > static DEFINE_RWLOCK(entries_lock); > static struct file_system_type bm_fs_type; > @@ -67,13 +67,13 @@ static int entry_count; > * if we do, return the node, else NULL > * locking is done in load_misc_binary > */ > -static Node *check_file(struct linux_binprm *bprm) > +static struct bm_node *check_file(struct linux_binprm *bprm) > { > + struct bm_node *e; > char *p = strrchr(bprm->interp, '.'); > - struct list_head *l; > > - list_for_each(l, &entries) { > - Node *e = list_entry(l, Node, list); > + > + list_for_each_entry(e, &entries, list) { > char *s; > int j; > > @@ -107,7 +107,7 @@ static Node *check_file(struct linux_binprm *bprm) > */ > static int load_misc_binary(struct linux_binprm *bprm) > { > - Node *fmt; > + struct bm_node *fmt; > struct file * interp_file = NULL; > char iname[BINPRM_BUF_SIZE]; > const char *iname_addr = iname; > @@ -235,7 +235,7 @@ static char *scanarg(char *s, char del) > return s; > } > > -static char * check_special_flags (char * sfs, Node * e) > +static char *check_special_flags(char *sfs, struct bm_node *e) > { > char * p = sfs; > int cont = 1; > @@ -270,9 +270,9 @@ static char * check_special_flags (char * sfs, Node * e) > * ':name:type:offset:magic:mask:interpreter:flags' > * where the ':' is the IFS, that can be chosen with the first char > */ > -static Node *create_entry(const char __user *buffer, size_t count) > +static struct bm_node *create_entry(const char __user *buffer, size_t count) > { > - Node *e; > + struct bm_node *e; > int memsize, err; > char *buf, *p; > char del; > @@ -283,14 +283,14 @@ static Node *create_entry(const char __user *buffer, size_t count) > goto out; > > err = -ENOMEM; > - memsize = sizeof(Node) + count + 8; > + memsize = sizeof(struct bm_node) + count + 8; > e = kmalloc(memsize, GFP_USER); > if (!e) > goto out; > > - p = buf = (char *)e + sizeof(Node); > + p = buf = (char *)e + sizeof(*e); > > - memset(e, 0, sizeof(Node)); > + memset(e, 0, sizeof(*e)); > if (copy_from_user(buf, buffer, count)) > goto Efault; > > @@ -415,7 +415,7 @@ static int parse_command(const char __user *buffer, size_t count) > > /* generic stuff */ > > -static void entry_status(Node *e, char *page) > +static void entry_status(struct bm_node *e, char *page) > { > char *dp; > char *status = "disabled"; > @@ -490,7 +490,7 @@ static void bm_evict_inode(struct inode *inode) > kfree(inode->i_private); > } > > -static void kill_node(Node *e) > +static void kill_node(struct bm_node *e) > { > struct dentry *dentry; > > @@ -515,7 +515,7 @@ static void kill_node(Node *e) > static ssize_t > bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) > { > - Node *e = file_inode(file)->i_private; > + struct bm_node *e = file_inode(file)->i_private; > ssize_t res; > char *page; > > @@ -534,7 +534,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer, > size_t count, loff_t *ppos) > { > struct dentry *root; > - Node *e = file_inode(file)->i_private; > + struct bm_node *e = file_inode(file)->i_private; > int res = parse_command(buffer, count); > > switch (res) { > @@ -566,7 +566,7 @@ static const struct file_operations bm_entry_operations = { > static ssize_t bm_register_write(struct file *file, const char __user *buffer, > size_t count, loff_t *ppos) > { > - Node *e; > + struct bm_node *e; > struct inode *inode; > struct dentry *root, *dentry; > struct super_block *sb = file->f_path.dentry->d_sb; > @@ -652,7 +652,8 @@ static ssize_t bm_status_write(struct file * file, const char __user * buffer, > mutex_lock(&root->d_inode->i_mutex); > > while (!list_empty(&entries)) > - kill_node(list_entry(entries.next, Node, list)); > + kill_node(list_entry(entries.next, > + struct bm_node, list)); > > mutex_unlock(&root->d_inode->i_mutex); > dput(root); > can anyone give me some suggestion? dan?