proc/stat: use defined macro KMALLOC_MAX_SIZE
authorYuanhan Liu <[email protected]>
Thu, 26 May 2011 23:25:51 +0000 (16:25 -0700)
committerLinus Torvalds <[email protected]>
Fri, 27 May 2011 00:12:37 +0000 (17:12 -0700)
There is a macro for the max size kmalloc can allocate, so use it instead
of a hardcoded number.

Signed-off-by: Yuanhan Liu <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/stat.c

index 1cffa2b8a2fcd5dc9a6b329ce29498ef9e24cab0..9758b654a1bcffe27c414ef322f34cd6a8658c33 100644 (file)
@@ -138,9 +138,9 @@ static int stat_open(struct inode *inode, struct file *file)
        struct seq_file *m;
        int res;
 
-       /* don't ask for more than the kmalloc() max size, currently 128 KB */
-       if (size > 128 * 1024)
-               size = 128 * 1024;
+       /* don't ask for more than the kmalloc() max size */
+       if (size > KMALLOC_MAX_SIZE)
+               size = KMALLOC_MAX_SIZE;
        buf = kmalloc(size, GFP_KERNEL);
        if (!buf)
                return -ENOMEM;