Skip to contentSkip to conversation

driver core: devtmpfs: fix compile failure

PATCH New Ming Lei 1 participant 1 message Apr 10, 2013 Driver core

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 driver core: devtmpfs: fix compile failure

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.

---
 drivers/base/devtmpfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/devtmpfs.c +2 -2
index fda5256..e268fc5 100644
@@ -211,8 +211,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);
Signature · 1 line
1.7.9.5