From: Harvey Harrison <harvey.harrison@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] cpuset: sparse warnings in cpuset.c
Date: Sat, 02 Feb 2008 22:20:19 -0800 [thread overview]
Message-ID: <1202019619.1844.52.camel@brick> (raw)
No need to redeclare p, we have finished with it at this point,
so reuse it in the for loop.
kernel/cpuset.c:824:23: warning: symbol 'p' shadows an earlier one
kernel/cpuset.c:746:21: originally declared here
kernel/cpuset.c:1272:52: warning: Using plain integer as NULL pointer
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
kernel/cpuset.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index cfaf641..fdbac43 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -821,7 +821,7 @@ static int update_cpumask(struct cpuset *cs, char *buf)
cgroup_iter_end(cgrp, &it);
if (heap.size) {
for (i = 0; i < heap.size; i++) {
- struct task_struct *p = heap.ptrs[i];
+ p = heap.ptrs[i];
if (i == 0) {
latest_time = p->start_time;
latest_task = p;
@@ -1269,7 +1269,8 @@ static ssize_t cpuset_common_file_write(struct cgroup *cont,
return -E2BIG;
/* +1 for nul-terminator */
- if ((buffer = kmalloc(nbytes + 1, GFP_KERNEL)) == 0)
+ buffer = kmalloc(nbytes + 1, GFP_KERNEL);
+ if (!buffer)
return -ENOMEM;
if (copy_from_user(buffer, userbuf, nbytes)) {
--
1.5.4.rc5.1138.g2602
next reply other threads:[~2008-02-03 6:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-03 6:20 Harvey Harrison [this message]
2008-02-03 7:28 ` [PATCH] cpuset: sparse warnings in cpuset.c Paul Jackson
2008-02-03 7:42 ` Harvey Harrison
2008-02-03 7:57 ` Paul Jackson
2008-02-23 8:04 ` Andrew Morton
2008-02-23 13:08 ` Paul Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1202019619.1844.52.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox