summaryrefslogtreecommitdiff
path: root/fs/proc/stat.c
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2014-07-29 06:09:42 +0900
committerKukjin Kim <kgene.kim@samsung.com>2014-07-29 06:09:42 +0900
commit6da287ad0266cca1fa8f88fb8b1c466e8164671f (patch)
treecfdf86c200bf9f1199c45acf51644fc185c705ec /fs/proc/stat.c
parentccaba4527156da1619a23bafcb944e8e029d0573 (diff)
parent6887d9e5682886b5d9fe81217ff2f1410724cdb9 (diff)
Merge branch 'v3.17-next/power-exynos' into v3.17-next/dt-samsung-2
Diffstat (limited to 'fs/proc/stat.c')
-rw-r--r--fs/proc/stat.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 9d231e9e5f0e..bf2d03f8fd3e 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -184,29 +184,11 @@ static int show_stat(struct seq_file *p, void *v)
static int stat_open(struct inode *inode, struct file *file)
{
- size_t size = 1024 + 128 * num_possible_cpus();
- char *buf;
- struct seq_file *m;
- int res;
+ size_t size = 1024 + 128 * num_online_cpus();
/* minimum size to display an interrupt count : 2 bytes */
size += 2 * nr_irqs;
-
- /* 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;
-
- res = single_open(file, show_stat, NULL);
- if (!res) {
- m = file->private_data;
- m->buf = buf;
- m->size = ksize(buf);
- } else
- kfree(buf);
- return res;
+ return single_open_size(file, show_stat, NULL, size);
}
static const struct file_operations proc_stat_operations = {