]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
proc: set attributes of pde using accessor functions
authorRui Xiang <rui.xiang@huawei.com>
Fri, 3 Jan 2014 03:10:29 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:29 +0000 (14:10 +1100)
Use existing accessors proc_set_user() and proc_set_size() to set
attributes.  Just a cleanup.

Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/generic.c
fs/proc/proc_devtree.c

index cca93b6fb9a9e841cc480308968771125fb7cd87..b7f268eb5f45251ae1977c643540e081c6612546 100644 (file)
@@ -49,8 +49,7 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
        setattr_copy(inode, iattr);
        mark_inode_dirty(inode);
 
-       de->uid = inode->i_uid;
-       de->gid = inode->i_gid;
+       proc_set_user(de, inode->i_uid, inode->i_gid);
        de->mode = inode->i_mode;
        return 0;
 }
index 70779b2fc2090b98b741d10f3f37c4a8c1379bf9..c824187251f67acfac50a5f5551e2a165dcf2fff 100644 (file)
@@ -74,9 +74,9 @@ __proc_device_tree_add_prop(struct proc_dir_entry *de, struct property *pp,
                return NULL;
 
        if (!strncmp(name, "security-", 9))
-               ent->size = 0; /* don't leak number of password chars */
+               proc_set_size(ent, 0); /* don't leak number of password chars */
        else
-               ent->size = pp->length;
+               proc_set_size(ent, pp->length);
 
        return ent;
 }