Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

security/capability.h: cap_issubset/isclear can be boolean

This patch makes cap_issubset/isclear return bool due to these
functions only using either one or zero as their return
value.

No functional change.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>

authored by

Yaowei Bai and committed by
James Morris
e42852bf f70be6da

+8 -8
+8 -8
include/linux/capability.h
··· 145 145 return dest; 146 146 } 147 147 148 - static inline int cap_isclear(const kernel_cap_t a) 148 + static inline bool cap_isclear(const kernel_cap_t a) 149 149 { 150 150 unsigned __capi; 151 151 CAP_FOR_EACH_U32(__capi) { 152 152 if (a.cap[__capi] != 0) 153 - return 0; 153 + return false; 154 154 } 155 - return 1; 155 + return true; 156 156 } 157 157 158 158 /* 159 159 * Check if "a" is a subset of "set". 160 - * return 1 if ALL of the capabilities in "a" are also in "set" 161 - * cap_issubset(0101, 1111) will return 1 162 - * return 0 if ANY of the capabilities in "a" are not in "set" 163 - * cap_issubset(1111, 0101) will return 0 160 + * return true if ALL of the capabilities in "a" are also in "set" 161 + * cap_issubset(0101, 1111) will return true 162 + * return false if ANY of the capabilities in "a" are not in "set" 163 + * cap_issubset(1111, 0101) will return false 164 164 */ 165 - static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set) 165 + static inline bool cap_issubset(const kernel_cap_t a, const kernel_cap_t set) 166 166 { 167 167 kernel_cap_t dest; 168 168 dest = cap_drop(a, set);