Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25ce3191 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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 1f33c41c ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c2f0b61d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -632,7 +632,9 @@ static int children_seq_show(struct seq_file *seq, void *v)
	pid_t pid;

	pid = pid_nr_ns(v, inode->i_sb->s_fs_info);
	return seq_printf(seq, "%d ", pid);
	seq_printf(seq, "%d ", pid);

	return 0;
}

static void *children_seq_start(struct seq_file *seq, loff_t *pos)
+47 −35
Original line number Diff line number Diff line
@@ -238,13 +238,15 @@ static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns,

	wchan = get_wchan(task);

	if (lookup_symbol_name(wchan, symname) < 0)
	if (lookup_symbol_name(wchan, symname) < 0) {
		if (!ptrace_may_access(task, PTRACE_MODE_READ))
			return 0;
		else
			return seq_printf(m, "%lu", wchan);
	else
		return seq_printf(m, "%s", symname);
		seq_printf(m, "%lu", wchan);
	} else {
		seq_printf(m, "%s", symname);
	}

	return 0;
}
#endif /* CONFIG_KALLSYMS */

@@ -309,10 +311,12 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns,
			      struct pid *pid, struct task_struct *task)
{
	return seq_printf(m, "%llu %llu %lu\n",
	seq_printf(m, "%llu %llu %lu\n",
		   (unsigned long long)task->se.sum_exec_runtime,
		   (unsigned long long)task->sched_info.run_delay,
		   task->sched_info.pcount);

	return 0;
}
#endif

@@ -387,7 +391,9 @@ static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns,
		points = oom_badness(task, NULL, NULL, totalpages) *
						1000 / totalpages;
	read_unlock(&tasklist_lock);
	return seq_printf(m, "%lu\n", points);
	seq_printf(m, "%lu\n", points);

	return 0;
}

struct limit_names {
@@ -462,7 +468,9 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,
{
	long nr;
	unsigned long args[6], sp, pc;
	int res = lock_trace(task);
	int res;

	res = lock_trace(task);
	if (res)
		return res;

@@ -477,7 +485,8 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,
		       args[0], args[1], args[2], args[3], args[4], args[5],
		       sp, pc);
	unlock_trace(task);
	return res;

	return 0;
}
#endif /* CONFIG_HAVE_ARCH_TRACEHOOK */

@@ -2002,7 +2011,8 @@ static int show_timer(struct seq_file *m, void *v)
	notify = timer->it_sigev_notify;

	seq_printf(m, "ID: %d\n", timer->it_id);
	seq_printf(m, "signal: %d/%p\n", timer->sigq->info.si_signo,
	seq_printf(m, "signal: %d/%p\n",
		   timer->sigq->info.si_signo,
		   timer->sigq->info.si_value.sival_ptr);
	seq_printf(m, "notify: %s/%s.%d\n",
		   nstr[notify & ~SIGEV_THREAD_ID],
@@ -2352,7 +2362,7 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh

		unlock_task_sighand(task, &flags);
	}
	result = seq_printf(m,
	seq_printf(m,
		   "rchar: %llu\n"
		   "wchar: %llu\n"
		   "syscr: %llu\n"
@@ -2367,6 +2377,8 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh
		   (unsigned long long)acct.read_bytes,
		   (unsigned long long)acct.write_bytes,
		   (unsigned long long)acct.cancelled_write_bytes);
	result = 0;

out_unlock:
	mutex_unlock(&task->signal->cred_guard_mutex);
	return result;