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

From: Fabian Frederick
Date: Tue Jun 03 2014 - 16:01:28 EST


Use kernel.h definition.

Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/