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 <torvalds@linux-foundation.org>
This commit is contained in:
@@ -307,7 +307,7 @@ static inline void put_cred(const struct cred *_cred)
|
|||||||
#define get_current_user() \
|
#define get_current_user() \
|
||||||
({ \
|
({ \
|
||||||
struct user_struct *__u; \
|
struct user_struct *__u; \
|
||||||
struct cred *__cred; \
|
const struct cred *__cred; \
|
||||||
__cred = current_cred(); \
|
__cred = current_cred(); \
|
||||||
__u = get_uid(__cred->user); \
|
__u = get_uid(__cred->user); \
|
||||||
__u; \
|
__u; \
|
||||||
@@ -322,7 +322,7 @@ static inline void put_cred(const struct cred *_cred)
|
|||||||
#define get_current_groups() \
|
#define get_current_groups() \
|
||||||
({ \
|
({ \
|
||||||
struct group_info *__groups; \
|
struct group_info *__groups; \
|
||||||
struct cred *__cred; \
|
const struct cred *__cred; \
|
||||||
__cred = current_cred(); \
|
__cred = current_cred(); \
|
||||||
__groups = get_group_info(__cred->group_info); \
|
__groups = get_group_info(__cred->group_info); \
|
||||||
__groups; \
|
__groups; \
|
||||||
|
|||||||
Reference in New Issue
Block a user