From patchwork Fri Jun 22 15:35:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 9568 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4C7B723E55 for ; Fri, 22 Jun 2012 15:35:50 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1CA3FA18302 for ; Fri, 22 Jun 2012 15:35:50 +0000 (UTC) Received: by ggnf1 with SMTP id f1so1755781ggn.11 for ; Fri, 22 Jun 2012 08:35:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=hxGQfu/3NHELOKAXKAnziwJ1V+lKDqDUx7zJ7i2uOZE=; b=QLr4DgMmh6hEgfq1oHXy3Rs7m/z4FUXIFLkDRXV1ensi3MnUeIexVyeK8ZlwuD6dIi weXCCImF559Isrgq8BswDuYaN3BzhfZoYSdduSXLsDWght7Na8GMOiA6Gt/GxOHEWaRf dDr0GOS1O6P7vouR6NJwWTdKVrgnsCxh7D2Yh1q3VvHMDtNW4lXtBgwwX8AA1vSKwHeF 8y3+6XzjXTztZ+Zml4Yug2eoRl9scbU4c2Q5Gv08MQBJVqqM/peh5PNlCrsxvAMxUx+K U0any48NifxGpghhHrqvl12e+xvZDuEFPPmal8+bTRKq4rQAfXuuEXAcIAZ9UapsMypE Gxyg== Received: by 10.42.210.193 with SMTP id gl1mr370475icb.57.1340379349476; Fri, 22 Jun 2012 08:35:49 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp72335ibb; Fri, 22 Jun 2012 08:35:45 -0700 (PDT) Received: by 10.68.227.197 with SMTP id sc5mr12008313pbc.58.1340379344692; Fri, 22 Jun 2012 08:35:44 -0700 (PDT) Received: from e38.co.us.ibm.com (e38.co.us.ibm.com. [32.97.110.159]) by mx.google.com with ESMTPS id tx7si10107053pbc.29.2012.06.22.08.35.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jun 2012 08:35:44 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.159 as permitted sender) client-ip=32.97.110.159; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.159 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jun 2012 09:35:43 -0600 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Jun 2012 09:35:42 -0600 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id B1D51C9005A for ; Fri, 22 Jun 2012 11:35:39 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5MFZdZ0215816 for ; Fri, 22 Jun 2012 11:35:39 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5MFZFcK023125 for ; Fri, 22 Jun 2012 09:35:17 -0600 Received: from paulmck-ThinkPad-W500 ([9.47.24.152]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5MFZFDo023081; Fri, 22 Jun 2012 09:35:15 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id F3ACBE71AA; Fri, 22 Jun 2012 08:35:14 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 06/17] rcu: Remove return value from RCU_INIT_POINTER() Date: Fri, 22 Jun 2012 08:35:01 -0700 Message-Id: <1340379312-6684-6-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1340379312-6684-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120622153501.GA6626@linux.vnet.ibm.com> <1340379312-6684-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12062215-5518-0000-0000-0000056D6701 X-Gm-Message-State: ALoCoQmDXFZHARJjTu89fOfu30zdP/64UA1KJg86w0JzT0tmF3bx1AE1Cy6YOUN9sN9EGDeVGKQ0 From: "Paul E. McKenney" The return value from RCU_INIT_POINTER() is not used, and using it would be quite ugly, for example: q = RCU_INIT_POINTER(global_p, p); To prevent this sort of ugliness from appearing, this commit wraps RCU_INIT_POINTER() in a do-while loop. Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett Acked-by: David Howells --- include/linux/rcupdate.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 88e4e08..267dc77 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -904,7 +904,9 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) * the reader-accessible portions of the linked structure. */ #define RCU_INIT_POINTER(p, v) \ - p = (typeof(*v) __force __rcu *)(v) + do { \ + p = (typeof(*v) __force __rcu *)(v); \ + } while (0) /** * RCU_POINTER_INITIALIZER() - statically initialize an RCU protected pointer