mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
posix_types.h: Cleanup stale __NFDBITS and related definitions
Recently, glibc made a change to suppress sign-conversion warnings in
FD_SET (glibc commit ceb9e56b3d1). This uncovered an issue with the
kernel's definition of __NFDBITS if applications #include
<linux/types.h> after including <sys/select.h>. A build failure would
be seen when passing the -Werror=sign-compare and -D_FORTIFY_SOURCE=2
flags to gcc.
It was suggested that the kernel should either match the glibc
definition of __NFDBITS or remove that entirely. The current in-kernel
uses of __NFDBITS can be replaced with BITS_PER_LONG, and there are no
uses of the related __FDELT and __FDMASK defines. Given that, we'll
continue the cleanup that was started with commit 8b3d1cda4f
("posix_types: Remove fd_set macros") and drop the remaining unused
macros.
Additionally, linux/time.h has similar macros defined that expand to
nothing so we'll remove those at the same time.
Reported-by: Jeff Law <[email protected]>
Suggested-by: Linus Torvalds <[email protected]>
CC: <[email protected]>
Signed-off-by: Josh Boyer <[email protected]>
[ .. and fix up whitespace as per akpm ]
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4cb38750d4
commit
8ded2bbc18
7 changed files with 12 additions and 32 deletions
|
|
@ -2129,7 +2129,7 @@ static inline void flush_unauthorized_files(const struct cred *cred,
|
|||
int fd;
|
||||
|
||||
j++;
|
||||
i = j * __NFDBITS;
|
||||
i = j * BITS_PER_LONG;
|
||||
fdt = files_fdtable(files);
|
||||
if (i >= fdt->max_fds)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue