mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + wait-explain-the-shadowing-and-type-inconsistencies.patch added to -mm tree
@ 2014-04-09 19:04 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2014-04-09 19:04 UTC (permalink / raw)
  To: mm-commits, akpm, peterz

Subject: + wait-explain-the-shadowing-and-type-inconsistencies.patch added to -mm tree
To: peterz@infradead.org,akpm@linux-foundation.org
From: akpm@linux-foundation.org
Date: Wed, 09 Apr 2014 12:04:44 -0700


The patch titled
     Subject: wait: explain the shadowing and type inconsistencies
has been added to the -mm tree.  Its filename is
     wait-explain-the-shadowing-and-type-inconsistencies.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/wait-explain-the-shadowing-and-type-inconsistencies.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/wait-explain-the-shadowing-and-type-inconsistencies.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Peter Zijlstra <peterz@infradead.org>
Subject: wait: explain the shadowing and type inconsistencies

Stick in a comment before someone else tries to fix the sparse warning
this generates.

Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-o2ro6f3vkxklni0bc8f7m68s@git.kernel.org
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/wait.h |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff -puN include/linux/wait.h~wait-explain-the-shadowing-and-type-inconsistencies include/linux/wait.h
--- a/include/linux/wait.h~wait-explain-the-shadowing-and-type-inconsistencies
+++ a/include/linux/wait.h
@@ -191,11 +191,23 @@ wait_queue_head_t *bit_waitqueue(void *,
 	(!__builtin_constant_p(state) ||				\
 		state == TASK_INTERRUPTIBLE || state == TASK_KILLABLE)	\
 
+/*
+ * The below macro ___wait_event() has an explicit shadow of the __ret
+ * variable when used from the wait_event_*() macros.
+ *
+ * This is so that both can use the ___wait_cond_timeout() construct
+ * to wrap the condition.
+ *
+ * The type inconsistency of the wait_event_*() __ret variable is also
+ * on purpose; we use long where we can return timeout values and int
+ * otherwise.
+ */
+
 #define ___wait_event(wq, condition, state, exclusive, ret, cmd)	\
 ({									\
 	__label__ __out;						\
 	wait_queue_t __wait;						\
-	long __ret = ret;						\
+	long __ret = ret;	/* explicit shadow */			\
 									\
 	INIT_LIST_HEAD(&__wait.task_list);				\
 	if (exclusive)							\
_

Patches currently in -mm which might be from peterz@infradead.org are

origin.patch
wait-explain-the-shadowing-and-type-inconsistencies.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-04-09 19:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-09 19:04 + wait-explain-the-shadowing-and-type-inconsistencies.patch added to -mm tree akpm

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).