aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2010-08-09 20:19:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:45:02 -0400
commit7ee92255470daa0edb93866aec6e27534cd9a177 (patch)
tree07dd62d172fc6c174ae5bbe697851a36b2a1e43d /drivers/base
parent9a5b489b870def9a93f5e89dac03ebe136f901db (diff)
drivers/base/node.c: reduce stack usage of node_read_meminfo()
drivers/base/node.c: In function 'node_read_meminfo': drivers/base/node.c:139: warning: the frame size of 848 bytes is larger than 512 bytes Fix it by splitting the sprintf() into three parts. It has no functional change. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/node.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 2bdd8a94ec94..2872e86837b2 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -66,8 +66,7 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
66 struct sysinfo i; 66 struct sysinfo i;
67 67
68 si_meminfo_node(&i, nid); 68 si_meminfo_node(&i, nid);
69 69 n = sprintf(buf,
70 n = sprintf(buf, "\n"
71 "Node %d MemTotal: %8lu kB\n" 70 "Node %d MemTotal: %8lu kB\n"
72 "Node %d MemFree: %8lu kB\n" 71 "Node %d MemFree: %8lu kB\n"
73 "Node %d MemUsed: %8lu kB\n" 72 "Node %d MemUsed: %8lu kB\n"
@@ -78,13 +77,33 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
78 "Node %d Active(file): %8lu kB\n" 77 "Node %d Active(file): %8lu kB\n"
79 "Node %d Inactive(file): %8lu kB\n" 78 "Node %d Inactive(file): %8lu kB\n"
80 "Node %d Unevictable: %8lu kB\n" 79 "Node %d Unevictable: %8lu kB\n"
81 "Node %d Mlocked: %8lu kB\n" 80 "Node %d Mlocked: %8lu kB\n",
81 nid, K(i.totalram),
82 nid, K(i.freeram),
83 nid, K(i.totalram - i.freeram),
84 nid, K(node_page_state(nid, NR_ACTIVE_ANON) +
85 node_page_state(nid, NR_ACTIVE_FILE)),
86 nid, K(node_page_state(nid, NR_INACTIVE_ANON) +
87 node_page_state(nid, NR_INACTIVE_FILE)),
88 nid, K(node_page_state(nid, NR_ACTIVE_ANON)),
89 nid, K(node_page_state(nid, NR_INACTIVE_ANON)),
90 nid, K(node_page_state(nid, NR_ACTIVE_FILE)),
91 nid, K(node_page_state(nid, NR_INACTIVE_FILE)),
92 nid, K(node_page_state(nid, NR_UNEVICTABLE)),
93 nid, K(node_page_state(nid, NR_MLOCK)));
94
82#ifdef CONFIG_HIGHMEM 95#ifdef CONFIG_HIGHMEM
96 n += sprintf(buf + n,
83 "Node %d HighTotal: %8lu kB\n" 97 "Node %d HighTotal: %8lu kB\n"
84 "Node %d HighFree: %8lu kB\n" 98 "Node %d HighFree: %8lu kB\n"
85 "Node %d LowTotal: %8lu kB\n" 99 "Node %d LowTotal: %8lu kB\n"
86 "Node %d LowFree: %8lu kB\n" 100 "Node %d LowFree: %8lu kB\n",
101 nid, K(i.totalhigh),
102 nid, K(i.freehigh),
103 nid, K(i.totalram - i.totalhigh),
104 nid, K(i.freeram - i.freehigh));
87#endif 105#endif
106 n += sprintf(buf + n,
88 "Node %d Dirty: %8lu kB\n" 107 "Node %d Dirty: %8lu kB\n"
89 "Node %d Writeback: %8lu kB\n" 108 "Node %d Writeback: %8lu kB\n"
90 "Node %d FilePages: %8lu kB\n" 109 "Node %d FilePages: %8lu kB\n"
@@ -99,25 +118,6 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
99 "Node %d Slab: %8lu kB\n" 118 "Node %d Slab: %8lu kB\n"
100 "Node %d SReclaimable: %8lu kB\n" 119 "Node %d SReclaimable: %8lu kB\n"
101 "Node %d SUnreclaim: %8lu kB\n", 120 "Node %d SUnreclaim: %8lu kB\n",
102 nid, K(i.totalram),
103 nid, K(i.freeram),
104 nid, K(i.totalram - i.freeram),
105 nid, K(node_page_state(nid, NR_ACTIVE_ANON) +
106 node_page_state(nid, NR_ACTIVE_FILE)),
107 nid, K(node_page_state(nid, NR_INACTIVE_ANON) +
108 node_page_state(nid, NR_INACTIVE_FILE)),
109 nid, K(node_page_state(nid, NR_ACTIVE_ANON)),
110 nid, K(node_page_state(nid, NR_INACTIVE_ANON)),
111 nid, K(node_page_state(nid, NR_ACTIVE_FILE)),
112 nid, K(node_page_state(nid, NR_INACTIVE_FILE)),
113 nid, K(node_page_state(nid, NR_UNEVICTABLE)),
114 nid, K(node_page_state(nid, NR_MLOCK)),
115#ifdef CONFIG_HIGHMEM
116 nid, K(i.totalhigh),
117 nid, K(i.freehigh),
118 nid, K(i.totalram - i.totalhigh),
119 nid, K(i.freeram - i.freehigh),
120#endif
121 nid, K(node_page_state(nid, NR_FILE_DIRTY)), 121 nid, K(node_page_state(nid, NR_FILE_DIRTY)),
122 nid, K(node_page_state(nid, NR_WRITEBACK)), 122 nid, K(node_page_state(nid, NR_WRITEBACK)),
123 nid, K(node_page_state(nid, NR_FILE_PAGES)), 123 nid, K(node_page_state(nid, NR_FILE_PAGES)),