From patchwork Mon Jun 25 04:02:50 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: 9592 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 D69F223F19 for ; Mon, 25 Jun 2012 04:03:01 +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 851F6A180E5 for ; Mon, 25 Jun 2012 04:03:01 +0000 (UTC) Received: by ggnf1 with SMTP id f1so2736720ggn.11 for ; Sun, 24 Jun 2012 21:03:01 -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:date:from :to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-content-scanned:x-cbid:x-gm-message-state; bh=41Lay+yysC88HBQ1NtglWS3QeW4IvVQMfCSHABt+BLQ=; b=YDaaSWFBBPaT+kILyvNgte6IRmuIBS9Og7k5LDtnO2I+1hlTslynZpZDq3YpganP1y SzUZMUN4yqVUBz8EcKN1Jpc0xLEtycE8g0qzpdgymnfVR/4/6EdzsPFbzBGAZYGC9ich Y4M0TIJ6Ik6EMYNqcR4QCK7QUNPsLY4O+acPi8r/9IvS3n/HDB9uZSSwLdDJ+wlWa9JT q2GN1XXcq4r/BjwhlUF3H2tnKF73gPhOWQ8PuNizGdDKqQ26Dl2bdXJAUUcwdT9poUbz /PStc2COd0Y6xUaUwVCuFzVQ+ZeE9eP+F3zKwgJvjwmjOUKw0uDAFp2+NP2hYzeJfjaq L5nw== Received: by 10.50.195.234 with SMTP id ih10mr7008371igc.0.1340596980811; Sun, 24 Jun 2012 21:03:00 -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 v20csp31255ibb; Sun, 24 Jun 2012 21:02:59 -0700 (PDT) Received: by 10.68.138.169 with SMTP id qr9mr36262534pbb.27.1340596978845; Sun, 24 Jun 2012 21:02:58 -0700 (PDT) Received: from e39.co.us.ibm.com (e39.co.us.ibm.com. [32.97.110.160]) by mx.google.com with ESMTPS id pv10si8761825pbb.4.2012.06.24.21.02.58 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Jun 2012 21:02:58 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.160 as permitted sender) client-ip=32.97.110.160; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.160 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 24 Jun 2012 22:02:57 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 24 Jun 2012 22:02:56 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id A057919D8053 for ; Mon, 25 Jun 2012 04:02:52 +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 q5P42tXL218490 for ; Sun, 24 Jun 2012 22:02:55 -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 q5P42rCn023475 for ; Sun, 24 Jun 2012 22:02:55 -0600 Received: from paulmck-ThinkPad-W500 ([9.80.14.18]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5P42qHk023455; Sun, 24 Jun 2012 22:02:53 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id B8D3CE7DFC; Sun, 24 Jun 2012 21:02:50 -0700 (PDT) Date: Sun, 24 Jun 2012 21:02:50 -0700 From: "Paul E. McKenney" To: David Howells Cc: linux-kernel@vger.kernel.org, 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, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org Subject: Re: [PATCH tip/core/rcu 07/17] key: Remove extraneous parentheses from rcu_assign_keypointer() Message-ID: <20120625040250.GA11575@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1340379312-6684-7-git-send-email-paulmck@linux.vnet.ibm.com> <20120622153501.GA6626@linux.vnet.ibm.com> <1340379312-6684-1-git-send-email-paulmck@linux.vnet.ibm.com> <29983.1340381076@redhat.com> <20120623055932.GF2516@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120623055932.GF2516@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12062504-4242-0000-0000-0000021A626F X-Gm-Message-State: ALoCoQm8Qbq279ndqXF8/d0d5/lFdr2rcdCph9ecirg6Y4dtgNsFS2gepFyiVsv9pyOsnhZC30B9 On Fri, Jun 22, 2012 at 10:59:32PM -0700, Paul E. McKenney wrote: > On Fri, Jun 22, 2012 at 05:04:36PM +0100, David Howells wrote: > > Paul E. McKenney wrote: > > > > > This commit removes the extraneous parentheses from rcu_assign_keypointer() > > > so that rcu_assign_pointer() can be wrapped in do-while. > > > > Should it be wrapped in a do-while itself then? > > > > And whilst you're at it, could you wrap PAYLOAD in parentheses? > > Will do! Before I forget again... Is this what you had in mind? Thanx, Paul ------------------------------------------------------------------------ key: Remove extraneous parentheses from rcu_assign_keypointer() This commit removes the extraneous parentheses from rcu_assign_keypointer() so that rcu_assign_pointer() can be wrapped in do-while. It also wraps rcu_assign_keypointer() in a do-while and parenthesizes its final argument, as suggested by David Howells. Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett diff --git a/include/linux/key.h b/include/linux/key.h index 4cd22ed..e3dbc54 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -303,7 +303,9 @@ static inline bool key_is_instantiated(const struct key *key) rwsem_is_locked(&((struct key *)(KEY))->sem))) #define rcu_assign_keypointer(KEY, PAYLOAD) \ - (rcu_assign_pointer((KEY)->payload.rcudata, PAYLOAD)) +do { \ + rcu_assign_pointer((KEY)->payload.rcudata, (PAYLOAD)) \ +while (0) #ifdef CONFIG_SYSCTL extern ctl_table key_sysctls[];