diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2011-01-12 20:00:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:16 -0500 |
commit | 9d6de12f70d2fb1487c4f482a21fed25fe74e0fd (patch) | |
tree | a5bc7cb77c710418c44e2b1c009e80d79e12e3ab /fs | |
parent | a2ade7b6ca37c808128810687cd56e8a44443e65 (diff) |
proc: use seq_puts()/seq_putc() where possible
For string without format specifiers, use seq_puts().
For seq_printf("\n"), use seq_putc('\n').
text data bss dec hex filename
61866 488 112 62466 f402 fs/proc/proc.o
61729 488 112 62329 f379 fs/proc/proc.o
----------------------------------------------------
-139
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/array.c | 22 | ||||
-rw-r--r-- | fs/proc/base.c | 2 | ||||
-rw-r--r-- | fs/proc/devices.c | 4 | ||||
-rw-r--r-- | fs/proc/proc_tty.c | 26 | ||||
-rw-r--r-- | fs/proc/softirqs.c | 6 | ||||
-rw-r--r-- | fs/proc/stat.c | 2 |
6 files changed, 31 insertions, 31 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 842a6564f2ce..df2b703b9d0f 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -95,7 +95,7 @@ static inline void task_name(struct seq_file *m, struct task_struct *p) | |||
95 | 95 | ||
96 | get_task_comm(tcomm, p); | 96 | get_task_comm(tcomm, p); |
97 | 97 | ||
98 | seq_printf(m, "Name:\t"); | 98 | seq_puts(m, "Name:\t"); |
99 | end = m->buf + m->size; | 99 | end = m->buf + m->size; |
100 | buf = m->buf + m->count; | 100 | buf = m->buf + m->count; |
101 | name = tcomm; | 101 | name = tcomm; |
@@ -122,7 +122,7 @@ static inline void task_name(struct seq_file *m, struct task_struct *p) | |||
122 | buf++; | 122 | buf++; |
123 | } | 123 | } |
124 | m->count = buf - m->buf; | 124 | m->count = buf - m->buf; |
125 | seq_printf(m, "\n"); | 125 | seq_putc(m, '\n'); |
126 | } | 126 | } |
127 | 127 | ||
128 | /* | 128 | /* |
@@ -208,7 +208,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns, | |||
208 | seq_printf(m, "%d ", GROUP_AT(group_info, g)); | 208 | seq_printf(m, "%d ", GROUP_AT(group_info, g)); |
209 | put_cred(cred); | 209 | put_cred(cred); |
210 | 210 | ||
211 | seq_printf(m, "\n"); | 211 | seq_putc(m, '\n'); |
212 | } | 212 | } |
213 | 213 | ||
214 | static void render_sigset_t(struct seq_file *m, const char *header, | 214 | static void render_sigset_t(struct seq_file *m, const char *header, |
@@ -216,7 +216,7 @@ static void render_sigset_t(struct seq_file *m, const char *header, | |||
216 | { | 216 | { |
217 | int i; | 217 | int i; |
218 | 218 | ||
219 | seq_printf(m, "%s", header); | 219 | seq_puts(m, header); |
220 | 220 | ||
221 | i = _NSIG; | 221 | i = _NSIG; |
222 | do { | 222 | do { |
@@ -230,7 +230,7 @@ static void render_sigset_t(struct seq_file *m, const char *header, | |||
230 | seq_printf(m, "%x", x); | 230 | seq_printf(m, "%x", x); |
231 | } while (i >= 4); | 231 | } while (i >= 4); |
232 | 232 | ||
233 | seq_printf(m, "\n"); | 233 | seq_putc(m, '\n'); |
234 | } | 234 | } |
235 | 235 | ||
236 | static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *ign, | 236 | static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *ign, |
@@ -291,12 +291,12 @@ static void render_cap_t(struct seq_file *m, const char *header, | |||
291 | { | 291 | { |
292 | unsigned __capi; | 292 | unsigned __capi; |
293 | 293 | ||
294 | seq_printf(m, "%s", header); | 294 | seq_puts(m, header); |
295 | CAP_FOR_EACH_U32(__capi) { | 295 | CAP_FOR_EACH_U32(__capi) { |
296 | seq_printf(m, "%08x", | 296 | seq_printf(m, "%08x", |
297 | a->cap[(_KERNEL_CAPABILITY_U32S-1) - __capi]); | 297 | a->cap[(_KERNEL_CAPABILITY_U32S-1) - __capi]); |
298 | } | 298 | } |
299 | seq_printf(m, "\n"); | 299 | seq_putc(m, '\n'); |
300 | } | 300 | } |
301 | 301 | ||
302 | static inline void task_cap(struct seq_file *m, struct task_struct *p) | 302 | static inline void task_cap(struct seq_file *m, struct task_struct *p) |
@@ -329,12 +329,12 @@ static inline void task_context_switch_counts(struct seq_file *m, | |||
329 | 329 | ||
330 | static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) | 330 | static void task_cpus_allowed(struct seq_file *m, struct task_struct *task) |
331 | { | 331 | { |
332 | seq_printf(m, "Cpus_allowed:\t"); | 332 | seq_puts(m, "Cpus_allowed:\t"); |
333 | seq_cpumask(m, &task->cpus_allowed); | 333 | seq_cpumask(m, &task->cpus_allowed); |
334 | seq_printf(m, "\n"); | 334 | seq_putc(m, '\n'); |
335 | seq_printf(m, "Cpus_allowed_list:\t"); | 335 | seq_puts(m, "Cpus_allowed_list:\t"); |
336 | seq_cpumask_list(m, &task->cpus_allowed); | 336 | seq_cpumask_list(m, &task->cpus_allowed); |
337 | seq_printf(m, "\n"); | 337 | seq_putc(m, '\n'); |
338 | } | 338 | } |
339 | 339 | ||
340 | int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, | 340 | int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 336b79803e82..bf6ba967cffb 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -386,7 +386,7 @@ static int lstats_show_proc(struct seq_file *m, void *v) | |||
386 | break; | 386 | break; |
387 | seq_printf(m, " %ps", (void *)bt); | 387 | seq_printf(m, " %ps", (void *)bt); |
388 | } | 388 | } |
389 | seq_printf(m, "\n"); | 389 | seq_putc(m, '\n'); |
390 | } | 390 | } |
391 | 391 | ||
392 | } | 392 | } |
diff --git a/fs/proc/devices.c b/fs/proc/devices.c index 59ee7da959c9..b14347167c35 100644 --- a/fs/proc/devices.c +++ b/fs/proc/devices.c | |||
@@ -9,14 +9,14 @@ static int devinfo_show(struct seq_file *f, void *v) | |||
9 | 9 | ||
10 | if (i < CHRDEV_MAJOR_HASH_SIZE) { | 10 | if (i < CHRDEV_MAJOR_HASH_SIZE) { |
11 | if (i == 0) | 11 | if (i == 0) |
12 | seq_printf(f, "Character devices:\n"); | 12 | seq_puts(f, "Character devices:\n"); |
13 | chrdev_show(f, i); | 13 | chrdev_show(f, i); |
14 | } | 14 | } |
15 | #ifdef CONFIG_BLOCK | 15 | #ifdef CONFIG_BLOCK |
16 | else { | 16 | else { |
17 | i -= CHRDEV_MAJOR_HASH_SIZE; | 17 | i -= CHRDEV_MAJOR_HASH_SIZE; |
18 | if (i == 0) | 18 | if (i == 0) |
19 | seq_printf(f, "\nBlock devices:\n"); | 19 | seq_puts(f, "\nBlock devices:\n"); |
20 | blkdev_show(f, i); | 20 | blkdev_show(f, i); |
21 | } | 21 | } |
22 | #endif | 22 | #endif |
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c index 83adcc869437..cb761f010300 100644 --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c | |||
@@ -36,27 +36,27 @@ static void show_tty_range(struct seq_file *m, struct tty_driver *p, | |||
36 | } | 36 | } |
37 | switch (p->type) { | 37 | switch (p->type) { |
38 | case TTY_DRIVER_TYPE_SYSTEM: | 38 | case TTY_DRIVER_TYPE_SYSTEM: |
39 | seq_printf(m, "system"); | 39 | seq_puts(m, "system"); |
40 | if (p->subtype == SYSTEM_TYPE_TTY) | 40 | if (p->subtype == SYSTEM_TYPE_TTY) |
41 | seq_printf(m, ":/dev/tty"); | 41 | seq_puts(m, ":/dev/tty"); |
42 | else if (p->subtype == SYSTEM_TYPE_SYSCONS) | 42 | else if (p->subtype == SYSTEM_TYPE_SYSCONS) |
43 | seq_printf(m, ":console"); | 43 | seq_puts(m, ":console"); |
44 | else if (p->subtype == SYSTEM_TYPE_CONSOLE) | 44 | else if (p->subtype == SYSTEM_TYPE_CONSOLE) |
45 | seq_printf(m, ":vtmaster"); | 45 | seq_puts(m, ":vtmaster"); |
46 | break; | 46 | break; |
47 | case TTY_DRIVER_TYPE_CONSOLE: | 47 | case TTY_DRIVER_TYPE_CONSOLE: |
48 | seq_printf(m, "console"); | 48 | seq_puts(m, "console"); |
49 | break; | 49 | break; |
50 | case TTY_DRIVER_TYPE_SERIAL: | 50 | case TTY_DRIVER_TYPE_SERIAL: |
51 | seq_printf(m, "serial"); | 51 | seq_puts(m, "serial"); |
52 | break; | 52 | break; |
53 | case TTY_DRIVER_TYPE_PTY: | 53 | case TTY_DRIVER_TYPE_PTY: |
54 | if (p->subtype == PTY_TYPE_MASTER) | 54 | if (p->subtype == PTY_TYPE_MASTER) |
55 | seq_printf(m, "pty:master"); | 55 | seq_puts(m, "pty:master"); |
56 | else if (p->subtype == PTY_TYPE_SLAVE) | 56 | else if (p->subtype == PTY_TYPE_SLAVE) |
57 | seq_printf(m, "pty:slave"); | 57 | seq_puts(m, "pty:slave"); |
58 | else | 58 | else |
59 | seq_printf(m, "pty"); | 59 | seq_puts(m, "pty"); |
60 | break; | 60 | break; |
61 | default: | 61 | default: |
62 | seq_printf(m, "type:%d.%d", p->type, p->subtype); | 62 | seq_printf(m, "type:%d.%d", p->type, p->subtype); |
@@ -74,19 +74,19 @@ static int show_tty_driver(struct seq_file *m, void *v) | |||
74 | /* pseudo-drivers first */ | 74 | /* pseudo-drivers first */ |
75 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/tty", "tty"); | 75 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/tty", "tty"); |
76 | seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 0); | 76 | seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 0); |
77 | seq_printf(m, "system:/dev/tty\n"); | 77 | seq_puts(m, "system:/dev/tty\n"); |
78 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/console", "console"); | 78 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/console", "console"); |
79 | seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 1); | 79 | seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 1); |
80 | seq_printf(m, "system:console\n"); | 80 | seq_puts(m, "system:console\n"); |
81 | #ifdef CONFIG_UNIX98_PTYS | 81 | #ifdef CONFIG_UNIX98_PTYS |
82 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/ptmx", "ptmx"); | 82 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/ptmx", "ptmx"); |
83 | seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 2); | 83 | seq_printf(m, "%3d %7d ", TTYAUX_MAJOR, 2); |
84 | seq_printf(m, "system\n"); | 84 | seq_puts(m, "system\n"); |
85 | #endif | 85 | #endif |
86 | #ifdef CONFIG_VT | 86 | #ifdef CONFIG_VT |
87 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/vc/0", "vc/0"); | 87 | seq_printf(m, "%-20s /dev/%-8s ", "/dev/vc/0", "vc/0"); |
88 | seq_printf(m, "%3d %7d ", TTY_MAJOR, 0); | 88 | seq_printf(m, "%3d %7d ", TTY_MAJOR, 0); |
89 | seq_printf(m, "system:vtmaster\n"); | 89 | seq_puts(m, "system:vtmaster\n"); |
90 | #endif | 90 | #endif |
91 | } | 91 | } |
92 | 92 | ||
diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c index 37994737c983..62604be9f58d 100644 --- a/fs/proc/softirqs.c +++ b/fs/proc/softirqs.c | |||
@@ -10,16 +10,16 @@ static int show_softirqs(struct seq_file *p, void *v) | |||
10 | { | 10 | { |
11 | int i, j; | 11 | int i, j; |
12 | 12 | ||
13 | seq_printf(p, " "); | 13 | seq_puts(p, " "); |
14 | for_each_possible_cpu(i) | 14 | for_each_possible_cpu(i) |
15 | seq_printf(p, "CPU%-8d", i); | 15 | seq_printf(p, "CPU%-8d", i); |
16 | seq_printf(p, "\n"); | 16 | seq_putc(p, '\n'); |
17 | 17 | ||
18 | for (i = 0; i < NR_SOFTIRQS; i++) { | 18 | for (i = 0; i < NR_SOFTIRQS; i++) { |
19 | seq_printf(p, "%12s:", softirq_to_name[i]); | 19 | seq_printf(p, "%12s:", softirq_to_name[i]); |
20 | for_each_possible_cpu(j) | 20 | for_each_possible_cpu(j) |
21 | seq_printf(p, " %10u", kstat_softirqs_cpu(i, j)); | 21 | seq_printf(p, " %10u", kstat_softirqs_cpu(i, j)); |
22 | seq_printf(p, "\n"); | 22 | seq_putc(p, '\n'); |
23 | } | 23 | } |
24 | return 0; | 24 | return 0; |
25 | } | 25 | } |
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index e15a19c93bae..1cffa2b8a2fc 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c | |||
@@ -126,7 +126,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
126 | 126 | ||
127 | for (i = 0; i < NR_SOFTIRQS; i++) | 127 | for (i = 0; i < NR_SOFTIRQS; i++) |
128 | seq_printf(p, " %u", per_softirq_sums[i]); | 128 | seq_printf(p, " %u", per_softirq_sums[i]); |
129 | seq_printf(p, "\n"); | 129 | seq_putc(p, '\n'); |
130 | 130 | ||
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |