mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Ingo Molnar <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, gregory.clement@free-electrons.com,
	hpa@zytor.com, mingo@kernel.org, akpm@linux-foundation.org,
	peterz@infradead.org, tglx@linutronix.de
Subject: [tip:core/locking] Revert "sched/wait: Suppress Sparse ' variable shadowing' warning"
Date: Thu, 27 Feb 2014 03:27:37 -0800	[thread overview]
Message-ID: <tip-f207dbe63c61158c234e2e8929a3725a7f6b2b9b@git.kernel.org> (raw)

Commit-ID:  f207dbe63c61158c234e2e8929a3725a7f6b2b9b
Gitweb:     http://git.kernel.org/tip/f207dbe63c61158c234e2e8929a3725a7f6b2b9b
Author:     Ingo Molnar <mingo@kernel.org>
AuthorDate: Thu, 27 Feb 2014 12:20:31 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 27 Feb 2014 12:20:31 +0100

Revert "sched/wait: Suppress Sparse 'variable shadowing' warning"

This reverts commit 980f88e414418bf65569a3b62b08b07e6fc2f4c6.

This warning is actually useful, don't suppress it.

We actually rely on the shadowing for ___wait_cond_timeout().

We further used the __ret variable in __wait_event_timeout()'s cmd
argument: __ret = schedule_timeout(__ret). That now explicitly uses the
wrong __ret.

Reported-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Requested-by: Andrew Morton <akpm@linux-foundation.org>
Requested-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-Q5blhuqqzwgVwvjf1gszrdol@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/wait.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index c55ea5c..559044c 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -195,7 +195,7 @@ wait_queue_head_t *bit_waitqueue(void *, int);
 ({									\
 	__label__ __out;						\
 	wait_queue_t __wait;						\
-	long ___ret = ret;						\
+	long __ret = ret;						\
 									\
 	INIT_LIST_HEAD(&__wait.task_list);				\
 	if (exclusive)							\
@@ -210,7 +210,7 @@ wait_queue_head_t *bit_waitqueue(void *, int);
 			break;						\
 									\
 		if (___wait_is_interruptible(state) && __int) {		\
-			___ret = __int;					\
+			__ret = __int;					\
 			if (exclusive) {				\
 				abort_exclusive_wait(&wq, &__wait,	\
 						     state, NULL);	\
@@ -222,7 +222,7 @@ wait_queue_head_t *bit_waitqueue(void *, int);
 		cmd;							\
 	}								\
 	finish_wait(&wq, &__wait);					\
-__out:	___ret;								\
+__out:	__ret;								\
 })
 
 #define __wait_event(wq, condition)					\

                 reply	other threads:[~2014-02-27 11: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=tip-f207dbe63c61158c234e2e8929a3725a7f6b2b9b@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®