Re: [glommer-memcg:slab-common/kmalloc 27/30] fs/proc/stat.c:191:3: warning: large integer implicitly truncated to unsigned type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 28 Sep 2012, Fengguang Wu wrote:

> fs/proc/stat.c: In function 'stat_open':
> fs/proc/stat.c:191:3: warning: large integer implicitly truncated to unsigned type [-Woverflow]

I guess we need this patch:

Subject: stat: Use size_t for sizes instead of unsigned

On some platforms (such as IA64) the large page size may results in
slab allocations to be allowed of numbers that do not fit in 32 bit.

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

Index: linux/fs/proc/stat.c
===================================================================
--- linux.orig/fs/proc/stat.c	2012-09-18 12:21:56.301459334 -0500
+++ linux/fs/proc/stat.c	2012-09-28 12:33:29.428759019 -0500
@@ -178,7 +178,7 @@ static int show_stat(struct seq_file *p,

 static int stat_open(struct inode *inode, struct file *file)
 {
-	unsigned size = 1024 + 128 * num_possible_cpus();
+	size_t size = 1024 + 128 * num_possible_cpus();
 	char *buf;
 	struct seq_file *m;
 	int res;
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux