All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dong Fang <yp.fangdong@gmail.com>
To: Dong Fang <yp.fangdong@gmail.com>
Cc: viro@zeniv.linux.org.uk, miklos@szeredi.hu,
	linux-fsdevel@vger.kernel.org, fuse-devel@lists.sourceforge.net,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH 1/3] vfs: fixed some CamelCase coding style issue
Date: Mon, 05 Aug 2013 04:16:19 -0400	[thread overview]
Message-ID: <51FF5F53.8040004@gmail.com> (raw)
In-Reply-To: <1375239002-14856-2-git-send-email-yp.fangdong@gmail.com>

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?


  reply	other threads:[~2013-08-05  0:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31  2:49 [PATCH v2] fixed some coding style issues Dong Fang
2013-07-31  2:50 ` [PATCH 1/3] vfs: fixed some CamelCase coding style issue Dong Fang
2013-08-05  8:16   ` Dong Fang [this message]
2013-07-31  2:50 ` [PATCH 2/3] fs/fuse: use list_for_each_entry() for list traversing Dong Fang
2013-07-31  2:50 ` [PATCH 3/3] fs/vfs: " Dong Fang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51FF5F53.8040004@gmail.com \
    --to=yp.fangdong@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.