From: zhong jiang <zhongjiang@huawei.com>
To: <mingo@redhat.com>
Cc: <peterz@infradead.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] sched: psi: Fix a GCC uninitialized warning
Date: Wed, 19 Sep 2018 13:16:20 +0800 [thread overview]
Message-ID: <1537334180-31870-1-git-send-email-zhongjiang@huawei.com> (raw)
I find the following warning when compiling the kernel.
kernel/sched/psi.c:639:13: warning: 'rq' may be used uninitialized in this function [-Wmaybe-uninitialized]
struct rq *rq;
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
kernel/sched/psi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 7cdecfc..2d8a1f2 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -636,7 +636,7 @@ void cgroup_move_task(struct task_struct *task, struct css_set *to)
bool move_psi = !psi_disabled;
unsigned int task_flags = 0;
struct rq_flags rf;
- struct rq *rq;
+ struct rq *rq = NULL;
if (move_psi) {
rq = task_rq_lock(task, &rf);
--
1.7.12.4
reply other threads:[~2018-09-19 5:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1537334180-31870-1-git-send-email-zhongjiang@huawei.com \
--to=zhongjiang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).