]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
proc-use-kzalloc-instead-of-kmalloc-and-memset-fix
authorAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Sep 2012 00:22:17 +0000 (10:22 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Oct 2012 06:51:01 +0000 (16:51 +1000)
fix __proc_create() coding-style issues, remove unneeded zero-initialisations

Cc: yan <clouds.yan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/generic.c

index 38de015c0690dc9d038c7fa02195c8af534d2f67..0d80cef4cfb93ea5bbd423b6cf887039f15b093a 100644 (file)
@@ -605,7 +605,8 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
        unsigned int len;
 
        /* make sure name is valid */
-       if (!name || !strlen(name)) goto out;
+       if (!name || !strlen(name))
+               goto out;
 
        if (xlate_proc_name(name, parent, &fn) != 0)
                goto out;
@@ -617,18 +618,17 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
        len = strlen(fn);
 
        ent = kzalloc(sizeof(struct proc_dir_entry) + len + 1, GFP_KERNEL);
-       if (!ent) goto out;
+       if (!ent)
+               goto out;
 
        memcpy(ent->name, fn, len + 1);
        ent->namelen = len;
        ent->mode = mode;
        ent->nlink = nlink;
        atomic_set(&ent->count, 1);
-       ent->pde_users = 0;
        spin_lock_init(&ent->pde_unload_lock);
-       ent->pde_unload_completion = NULL;
        INIT_LIST_HEAD(&ent->pde_openers);
- out:
+out:
        return ent;
 }