diff options
| author | Joe Perches <joe@perches.com> | 2015-04-15 19:18:17 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:25 -0400 |
| commit | 25ce319167b517a913a2ba9fc80da8330dbc3249 (patch) | |
| tree | c82bc2dc6322a950c1951cc3e7cf311ca2e4a8bc /fs/proc | |
| parent | c2f0b61d8969adf0dfb11aea7b700740fde6420b (diff) | |
proc: remove use of seq_printf return value
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.
See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
seq_has_overflowed() and make public")
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
| -rw-r--r-- | fs/proc/array.c | 4 | ||||
| -rw-r--r-- | fs/proc/base.c | 82 |
2 files changed, 50 insertions, 36 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 13f047ad08e4..fd02a9ebfc30 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
| @@ -632,7 +632,9 @@ static int children_seq_show(struct seq_file *seq, void *v) | |||
| 632 | pid_t pid; | 632 | pid_t pid; |
| 633 | 633 | ||
| 634 | pid = pid_nr_ns(v, inode->i_sb->s_fs_info); | 634 | pid = pid_nr_ns(v, inode->i_sb->s_fs_info); |
| 635 | return seq_printf(seq, "%d ", pid); | 635 | seq_printf(seq, "%d ", pid); |
| 636 | |||
| 637 | return 0; | ||
| 636 | } | 638 | } |
| 637 | 639 | ||
| 638 | static void *children_seq_start(struct seq_file *seq, loff_t *pos) | 640 | static void *children_seq_start(struct seq_file *seq, loff_t *pos) |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 3f3d7aeb0712..7a3b82f986dd 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -238,13 +238,15 @@ static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns, | |||
| 238 | 238 | ||
| 239 | wchan = get_wchan(task); | 239 | wchan = get_wchan(task); |
| 240 | 240 | ||
| 241 | if (lookup_symbol_name(wchan, symname) < 0) | 241 | if (lookup_symbol_name(wchan, symname) < 0) { |
| 242 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) | 242 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
| 243 | return 0; | 243 | return 0; |
| 244 | else | 244 | seq_printf(m, "%lu", wchan); |
| 245 | return seq_printf(m, "%lu", wchan); | 245 | } else { |
| 246 | else | 246 | seq_printf(m, "%s", symname); |
| 247 | return seq_printf(m, "%s", symname); | 247 | } |
| 248 | |||
| 249 | return 0; | ||
| 248 | } | 250 | } |
| 249 | #endif /* CONFIG_KALLSYMS */ | 251 | #endif /* CONFIG_KALLSYMS */ |
| 250 | 252 | ||
| @@ -309,10 +311,12 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns, | |||
| 309 | static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns, | 311 | static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns, |
| 310 | struct pid *pid, struct task_struct *task) | 312 | struct pid *pid, struct task_struct *task) |
| 311 | { | 313 | { |
| 312 | return seq_printf(m, "%llu %llu %lu\n", | 314 | seq_printf(m, "%llu %llu %lu\n", |
| 313 | (unsigned long long)task->se.sum_exec_runtime, | 315 | (unsigned long long)task->se.sum_exec_runtime, |
| 314 | (unsigned long long)task->sched_info.run_delay, | 316 | (unsigned long long)task->sched_info.run_delay, |
| 315 | task->sched_info.pcount); | 317 | task->sched_info.pcount); |
| 318 | |||
| 319 | return 0; | ||
| 316 | } | 320 | } |
| 317 | #endif | 321 | #endif |
| 318 | 322 | ||
| @@ -387,7 +391,9 @@ static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns, | |||
| 387 | points = oom_badness(task, NULL, NULL, totalpages) * | 391 | points = oom_badness(task, NULL, NULL, totalpages) * |
| 388 | 1000 / totalpages; | 392 | 1000 / totalpages; |
| 389 | read_unlock(&tasklist_lock); | 393 | read_unlock(&tasklist_lock); |
| 390 | return seq_printf(m, "%lu\n", points); | 394 | seq_printf(m, "%lu\n", points); |
| 395 | |||
| 396 | return 0; | ||
| 391 | } | 397 | } |
| 392 | 398 | ||
| 393 | struct limit_names { | 399 | struct limit_names { |
| @@ -432,15 +438,15 @@ static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns, | |||
| 432 | * print the file header | 438 | * print the file header |
| 433 | */ | 439 | */ |
| 434 | seq_printf(m, "%-25s %-20s %-20s %-10s\n", | 440 | seq_printf(m, "%-25s %-20s %-20s %-10s\n", |
| 435 | "Limit", "Soft Limit", "Hard Limit", "Units"); | 441 | "Limit", "Soft Limit", "Hard Limit", "Units"); |
| 436 | 442 | ||
| 437 | for (i = 0; i < RLIM_NLIMITS; i++) { | 443 | for (i = 0; i < RLIM_NLIMITS; i++) { |
| 438 | if (rlim[i].rlim_cur == RLIM_INFINITY) | 444 | if (rlim[i].rlim_cur == RLIM_INFINITY) |
| 439 | seq_printf(m, "%-25s %-20s ", | 445 | seq_printf(m, "%-25s %-20s ", |
| 440 | lnames[i].name, "unlimited"); | 446 | lnames[i].name, "unlimited"); |
| 441 | else | 447 | else |
| 442 | seq_printf(m, "%-25s %-20lu ", | 448 | seq_printf(m, "%-25s %-20lu ", |
| 443 | lnames[i].name, rlim[i].rlim_cur); | 449 | lnames[i].name, rlim[i].rlim_cur); |
| 444 | 450 | ||
| 445 | if (rlim[i].rlim_max == RLIM_INFINITY) | 451 | if (rlim[i].rlim_max == RLIM_INFINITY) |
| 446 | seq_printf(m, "%-20s ", "unlimited"); | 452 | seq_printf(m, "%-20s ", "unlimited"); |
| @@ -462,7 +468,9 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns, | |||
| 462 | { | 468 | { |
| 463 | long nr; | 469 | long nr; |
| 464 | unsigned long args[6], sp, pc; | 470 | unsigned long args[6], sp, pc; |
| 465 | int res = lock_trace(task); | 471 | int res; |
| 472 | |||
| 473 | res = lock_trace(task); | ||
| 466 | if (res) | 474 | if (res) |
| 467 | return res; | 475 | return res; |
| 468 | 476 | ||
| @@ -477,7 +485,8 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns, | |||
| 477 | args[0], args[1], args[2], args[3], args[4], args[5], | 485 | args[0], args[1], args[2], args[3], args[4], args[5], |
| 478 | sp, pc); | 486 | sp, pc); |
| 479 | unlock_trace(task); | 487 | unlock_trace(task); |
| 480 | return res; | 488 | |
| 489 | return 0; | ||
| 481 | } | 490 | } |
| 482 | #endif /* CONFIG_HAVE_ARCH_TRACEHOOK */ | 491 | #endif /* CONFIG_HAVE_ARCH_TRACEHOOK */ |
| 483 | 492 | ||
| @@ -2002,12 +2011,13 @@ static int show_timer(struct seq_file *m, void *v) | |||
| 2002 | notify = timer->it_sigev_notify; | 2011 | notify = timer->it_sigev_notify; |
| 2003 | 2012 | ||
| 2004 | seq_printf(m, "ID: %d\n", timer->it_id); | 2013 | seq_printf(m, "ID: %d\n", timer->it_id); |
| 2005 | seq_printf(m, "signal: %d/%p\n", timer->sigq->info.si_signo, | 2014 | seq_printf(m, "signal: %d/%p\n", |
| 2006 | timer->sigq->info.si_value.sival_ptr); | 2015 | timer->sigq->info.si_signo, |
| 2016 | timer->sigq->info.si_value.sival_ptr); | ||
| 2007 | seq_printf(m, "notify: %s/%s.%d\n", | 2017 | seq_printf(m, "notify: %s/%s.%d\n", |
| 2008 | nstr[notify & ~SIGEV_THREAD_ID], | 2018 | nstr[notify & ~SIGEV_THREAD_ID], |
| 2009 | (notify & SIGEV_THREAD_ID) ? "tid" : "pid", | 2019 | (notify & SIGEV_THREAD_ID) ? "tid" : "pid", |
| 2010 | pid_nr_ns(timer->it_pid, tp->ns)); | 2020 | pid_nr_ns(timer->it_pid, tp->ns)); |
| 2011 | seq_printf(m, "ClockID: %d\n", timer->it_clock); | 2021 | seq_printf(m, "ClockID: %d\n", timer->it_clock); |
| 2012 | 2022 | ||
| 2013 | return 0; | 2023 | return 0; |
| @@ -2352,21 +2362,23 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh | |||
| 2352 | 2362 | ||
| 2353 | unlock_task_sighand(task, &flags); | 2363 | unlock_task_sighand(task, &flags); |
| 2354 | } | 2364 | } |
| 2355 | result = seq_printf(m, | 2365 | seq_printf(m, |
| 2356 | "rchar: %llu\n" | 2366 | "rchar: %llu\n" |
| 2357 | "wchar: %llu\n" | 2367 | "wchar: %llu\n" |
| 2358 | "syscr: %llu\n" | 2368 | "syscr: %llu\n" |
| 2359 | "syscw: %llu\n" | 2369 | "syscw: %llu\n" |
| 2360 | "read_bytes: %llu\n" | 2370 | "read_bytes: %llu\n" |
| 2361 | "write_bytes: %llu\n" | 2371 | "write_bytes: %llu\n" |
| 2362 | "cancelled_write_bytes: %llu\n", | 2372 | "cancelled_write_bytes: %llu\n", |
| 2363 | (unsigned long long)acct.rchar, | 2373 | (unsigned long long)acct.rchar, |
| 2364 | (unsigned long long)acct.wchar, | 2374 | (unsigned long long)acct.wchar, |
| 2365 | (unsigned long long)acct.syscr, | 2375 | (unsigned long long)acct.syscr, |
| 2366 | (unsigned long long)acct.syscw, | 2376 | (unsigned long long)acct.syscw, |
| 2367 | (unsigned long long)acct.read_bytes, | 2377 | (unsigned long long)acct.read_bytes, |
| 2368 | (unsigned long long)acct.write_bytes, | 2378 | (unsigned long long)acct.write_bytes, |
| 2369 | (unsigned long long)acct.cancelled_write_bytes); | 2379 | (unsigned long long)acct.cancelled_write_bytes); |
| 2380 | result = 0; | ||
| 2381 | |||
| 2370 | out_unlock: | 2382 | out_unlock: |
| 2371 | mutex_unlock(&task->signal->cred_guard_mutex); | 2383 | mutex_unlock(&task->signal->cred_guard_mutex); |
| 2372 | return result; | 2384 | return result; |
