mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
flag parameters: check magic constants
This patch adds test that ensure the boundary conditions for the various constants introduced in the previous patches is met. No code is generated. [[email protected]: fix alpha] Signed-off-by: Ulrich Drepper <[email protected]> Acked-by: Davide Libenzi <[email protected]> Cc: Michael Kerrisk <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
510df2dd48
commit
e38b36f325
6 changed files with 25 additions and 0 deletions
|
|
@ -203,6 +203,10 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags)
|
|||
int fd;
|
||||
struct eventfd_ctx *ctx;
|
||||
|
||||
/* Check the EFD_* constants for consistency. */
|
||||
BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
|
||||
BUILD_BUG_ON(EFD_NONBLOCK != O_NONBLOCK);
|
||||
|
||||
if (flags & ~(EFD_CLOEXEC | EFD_NONBLOCK))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue