2014-06-03 20:01:23

by Fabian Frédérick

[permalink] [raw]
Subject: [PATCH 1/1] fs/file.c: use SIZE_MAX instead of ~(size_t)0

Use kernel.h definition.

Cc: Alexander Viro <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Fabian Frederick <[email protected]>
---
fs/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/file.c b/fs/file.c
index 8f294cf..d63f731 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -27,7 +27,7 @@ int sysctl_nr_open __read_mostly = 1024*1024;
int sysctl_nr_open_min = BITS_PER_LONG;
/* our max() is unusable in constant expressions ;-/ */
#define __const_max(x, y) ((x) < (y) ? (x) : (y))
-int sysctl_nr_open_max = __const_max(INT_MAX, ~(size_t)0/sizeof(void *)) &
+int sysctl_nr_open_max = __const_max(INT_MAX, SIZE_MAX/sizeof(void *)) &
-BITS_PER_LONG;

static void *alloc_fdmem(size_t size)
--
1.8.4.5