From: Linus Torvalds Date: Mon, 8 Aug 2011 18:33:23 +0000 (-0700) Subject: cred: use 'const' in get_current_{user,groups} X-Git-Tag: firefly_0821_release~3680^2~4690 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=638a8439096c582bdb523fcea9d875d3e1fed38a;p=firefly-linux-kernel-4.4.55.git cred: use 'const' in get_current_{user,groups} Avoid annoying warnings from these functions ("discards qualifiers") because they assign 'current_cred()' to a non-const pointer. Signed-off-by: Linus Torvalds --- diff --git a/include/linux/cred.h b/include/linux/cred.h index 8e2fd44eb160..40308969ed00 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -307,7 +307,7 @@ static inline void put_cred(const struct cred *_cred) #define get_current_user() \ ({ \ struct user_struct *__u; \ - struct cred *__cred; \ + const struct cred *__cred; \ __cred = current_cred(); \ __u = get_uid(__cred->user); \ __u; \ @@ -322,7 +322,7 @@ static inline void put_cred(const struct cred *_cred) #define get_current_groups() \ ({ \ struct group_info *__groups; \ - struct cred *__cred; \ + const struct cred *__cred; \ __cred = current_cred(); \ __groups = get_group_info(__cred->group_info); \ __groups; \