]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
driver core: devtmpfs: fix compile failure with CONFIG_UIDGID_STRICT_TYPE_CHECKS
authorMing Lei <ming.lei@canonical.com>
Wed, 10 Apr 2013 16:12:56 +0000 (00:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2013 16:36:06 +0000 (09:36 -0700)
If CONFIG_UIDGID_STRICT_TYPE_CHECKS is enalbed, the below compile
failure will be triggered:

drivers/base/devtmpfs.c: In function 'handle_create':
drivers/base/devtmpfs.c:214:19: error: incompatible types when assigning to type 'kuid_t' from type 'uid_t'
drivers/base/devtmpfs.c:215:19: error: incompatible types when assigning to type 'kgid_t' from type 'gid_t'
make[2]: *** [drivers/base/devtmpfs.o] Error 1

This patch fixes the compile failure.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/devtmpfs.c

index aadf6472428fd14c7bcd4b778e82ccf120c1bedd..abd4eee61d27bf4c44a92ca9f1a6d3fcc51366d5 100644 (file)
@@ -212,8 +212,8 @@ static int handle_create(const char *nodename, umode_t mode, uid_t uid,
                struct iattr newattrs;
 
                newattrs.ia_mode = mode;
-               newattrs.ia_uid = uid;
-               newattrs.ia_gid = gid;
+               newattrs.ia_uid = KUIDT_INIT(uid);
+               newattrs.ia_gid = KGIDT_INIT(gid);
                newattrs.ia_valid = ATTR_MODE|ATTR_UID|ATTR_GID;
                mutex_lock(&dentry->d_inode->i_mutex);
                notify_change(dentry, &newattrs);