From patchwork Fri Jun 15 20:13:07 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: 9343 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 6074323E5A for ; Fri, 15 Jun 2012 20:13:43 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 309A2A18368 for ; Fri, 15 Jun 2012 20:13:43 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so3061900yhp.11 for ; Fri, 15 Jun 2012 13:13:43 -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-ibm-iss-spamdetectors :x-ibm-iss-detailinfo:x-gm-message-state; bh=Mh2+AmjNIUPSzs+rPxXGkKuLagCZKqWVfg5T3FzBsrI=; b=V6owFgO+W+5Lx2/PmGhmxydoZDER+ojOkYiqnj1Ssgg28wKVzMacYOFmVxfKCTNzlZ J5Ieq28iehxKN5k70vOALlsEzg+2h5bWoKYYoY8jLwhbe5XbF6uoyS+itN47yYLQpgQQ 9QJOSK4edvP8xJYSQ1IaMMYCi2MDFiPB6qKzgy09UxmTobHlZpsrLH3FNR/78ymN43z0 z8LesSOGgy8KKrxF7zIFBcVQmor2KBHc7M9DwpbYHl7shMI21AEkxiFKXt0CAp04FKc8 W5FYnf10LQeZq6UjiWOxwVA6BNQKfexZUKN+TPEQXNOIOaR1i+Vyz0Cw6Pk2vz7OnvyX HPmw== Received: by 10.42.89.72 with SMTP id f8mr565121icm.33.1339791222691; Fri, 15 Jun 2012 13:13:42 -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 v20csp167550ibb; Fri, 15 Jun 2012 13:13:41 -0700 (PDT) Received: by 10.68.229.2 with SMTP id sm2mr23622701pbc.57.1339791221308; Fri, 15 Jun 2012 13:13:41 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com. [32.97.110.152]) by mx.google.com with ESMTPS id sr7si17709298pbc.306.2012.06.15.13.13.40 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jun 2012 13:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.152 as permitted sender) client-ip=32.97.110.152; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.152 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Jun 2012 14:13:40 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 15 Jun 2012 14:13:38 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 80E571FF002F for ; Fri, 15 Jun 2012 20:13:36 +0000 (WET) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5FKDQto222382 for ; Fri, 15 Jun 2012 14:13:26 -0600 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 q5FKDIFK015515 for ; Fri, 15 Jun 2012 14:13:25 -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 q5FKDI1R015496; Fri, 15 Jun 2012 14:13:18 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 50CECE71A1; Fri, 15 Jun 2012 13:13:18 -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, patches@linaro.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 06/14] rcu: Remove return value from RCU_INIT_POINTER() Date: Fri, 15 Jun 2012 13:13:07 -0700 Message-Id: <1339791195-26389-6-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1339791195-26389-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120615201256.GA26120@linux.vnet.ibm.com> <1339791195-26389-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061520-1780-0000-0000-0000067BE3CD X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000281; HX=3.00000190; KW=3.00000007; PH=3.00000001; SC=3.00000002; SDB=6.00148345; UDB=6.00033813; UTC=2012-06-15 20:13:39 X-Gm-Message-State: ALoCoQmNQtA6qKHpHHUcexjjaapqf1sw5e0aRpOeJlOZs7e2nbuA7YEl6zmATIIBTJq9mqKX05G0 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 --- 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 eb92c21..f2cca02 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) /** * INIT_RCU_POINTER() - statically initialize an RCU protected pointer