Skip to content

Commit 9a27e97

Browse files
Alexey Dobriyantorvalds
authored andcommitted
proc: use "unsigned int" in /proc/stat hook
Number of CPUs is never high enough to force 64-bit arithmetic. Save couple of bytes on x86_64. Link: http://lkml.kernel.org/r/20180627200710.GC18434@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 891ae71 commit 9a27e97

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/proc/stat.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static int show_stat(struct seq_file *p, void *v)
183183

184184
static int stat_open(struct inode *inode, struct file *file)
185185
{
186-
size_t size = 1024 + 128 * num_online_cpus();
186+
unsigned int size = 1024 + 128 * num_online_cpus();
187187

188188
/* minimum size to display an interrupt count : 2 bytes */
189189
size += 2 * nr_irqs;

0 commit comments

Comments
 (0)