2022-06-25 02:59:55

by kernel test robot

[permalink] [raw]
Subject: [sforshee:kuid-equality 2/2] include/linux/uidgid.h:63:16: error: implicit declaration of function 'uid_valid'; did you mean 'pfn_valid'?

tree: https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/linux.git kuid-equality
head: fb9ea59b896e3054b9652ea40d5dae8969b21638
commit: fb9ea59b896e3054b9652ea40d5dae8969b21638 [2/2] uidgid: Do not consider two invalid ids to be equal
config: i386-tinyconfig
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/linux.git/commit/?id=fb9ea59b896e3054b9652ea40d5dae8969b21638
git remote add sforshee https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/linux.git
git fetch --no-tags sforshee kuid-equality
git checkout fb9ea59b896e3054b9652ea40d5dae8969b21638
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 prepare

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

In file included from include/linux/ipc.h:6,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/sched.h:15,
from arch/x86/kernel/asm-offsets.c:10:
include/linux/uidgid.h: In function 'uid_eq':
>> include/linux/uidgid.h:63:16: error: implicit declaration of function 'uid_valid'; did you mean 'pfn_valid'? [-Werror=implicit-function-declaration]
63 | return uid_valid(left) && __kuid_val(left) == __kuid_val(right);
| ^~~~~~~~~
| pfn_valid
include/linux/uidgid.h: In function 'gid_eq':
>> include/linux/uidgid.h:68:16: error: implicit declaration of function 'gid_valid'; did you mean 'pfn_valid'? [-Werror=implicit-function-declaration]
68 | return gid_valid(left) && __kgid_val(left) == __kgid_val(right);
| ^~~~~~~~~
| pfn_valid
include/linux/uidgid.h: At top level:
>> include/linux/uidgid.h:111:20: error: conflicting types for 'uid_valid'; have 'bool(kuid_t)' {aka '_Bool(kuid_t)'}
111 | static inline bool uid_valid(kuid_t uid)
| ^~~~~~~~~
include/linux/uidgid.h:63:16: note: previous implicit declaration of 'uid_valid' with type 'int()'
63 | return uid_valid(left) && __kuid_val(left) == __kuid_val(right);
| ^~~~~~~~~
>> include/linux/uidgid.h:116:20: error: conflicting types for 'gid_valid'; have 'bool(kgid_t)' {aka '_Bool(kgid_t)'}
116 | static inline bool gid_valid(kgid_t gid)
| ^~~~~~~~~
include/linux/uidgid.h:68:16: note: previous implicit declaration of 'gid_valid' with type 'int()'
68 | return gid_valid(left) && __kgid_val(left) == __kgid_val(right);
| ^~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1200: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +63 include/linux/uidgid.h

60
61 static inline bool uid_eq(kuid_t left, kuid_t right)
62 {
> 63 return uid_valid(left) && __kuid_val(left) == __kuid_val(right);
64 }
65
66 static inline bool gid_eq(kgid_t left, kgid_t right)
67 {
> 68 return gid_valid(left) && __kgid_val(left) == __kgid_val(right);
69 }
70
71 static inline bool uid_gt(kuid_t left, kuid_t right)
72 {
73 return __kuid_val(left) > __kuid_val(right);
74 }
75
76 static inline bool gid_gt(kgid_t left, kgid_t right)
77 {
78 return __kgid_val(left) > __kgid_val(right);
79 }
80
81 static inline bool uid_gte(kuid_t left, kuid_t right)
82 {
83 return __kuid_val(left) >= __kuid_val(right);
84 }
85
86 static inline bool gid_gte(kgid_t left, kgid_t right)
87 {
88 return __kgid_val(left) >= __kgid_val(right);
89 }
90
91 static inline bool uid_lt(kuid_t left, kuid_t right)
92 {
93 return __kuid_val(left) < __kuid_val(right);
94 }
95
96 static inline bool gid_lt(kgid_t left, kgid_t right)
97 {
98 return __kgid_val(left) < __kgid_val(right);
99 }
100
101 static inline bool uid_lte(kuid_t left, kuid_t right)
102 {
103 return __kuid_val(left) <= __kuid_val(right);
104 }
105
106 static inline bool gid_lte(kgid_t left, kgid_t right)
107 {
108 return __kgid_val(left) <= __kgid_val(right);
109 }
110
> 111 static inline bool uid_valid(kuid_t uid)
112 {
113 return __kuid_val(uid) != (uid_t) -1;
114 }
115
> 116 static inline bool gid_valid(kgid_t gid)
117 {
118 return __kgid_val(gid) != (gid_t) -1;
119 }
120

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (5.03 kB)
config (29.91 kB)
Download all attachments