From: "Jan Beulich" Subject: Re: [PATCH 1/4] hvmloader: Fixup pci_write* macros Date: Tue, 16 Jun 2015 08:36:22 +0100 Message-ID: <557FEE1602000078000853F1@mail.emea.novell.com> References: <1434377752-15705-1-git-send-email-dslutz@verizon.com> <1434377752-15705-2-git-send-email-dslutz@verizon.com> <557EDEE0.9060901@citrix.com> <557EE198.1080303@one.verizon.com> <557EE2C7.6060801@citrix.com> <557F0A010200007800085012@mail.emea.novell.com> <20150615190939.6238e731@mdontu-l.dsd.bitdefender.biz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150615190939.6238e731@mdontu-l.dsd.bitdefender.biz> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?UTF-8?Q?Mihai=20Don=C8=9Bu?= Cc: Wei Liu , Ian Campbell , StefanoStabellini , Andrew Cooper , Ian Jackson , Don Slutz , Don Slutz , xen-devel@lists.xen.org, Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 15.06.15 at 18:09, wrote: > On Mon, 15 Jun 2015 16:23:13 +0100 Jan Beulich wrote: >> >>> On 15.06.15 at 16:35, wrote: >> > On 15/06/15 15:30, Don Slutz wrote: >> >> On 06/15/15 10:19, Andrew Cooper wrote: >> >>> Furthermore, what about devfn or reg? >> >>> >> >> devfn and reg do not need the bracketing since they are just passed, >> >> but I have no issue with adding the extra brackets. >> > >> > Macros, under all circumstances, should have all of their parameters >> > bracketed for safety. >> >> No, as this harms readability: >> >> #define macro(x) function((x)) >> >> would completely pointlessly be having an extra set of parentheses. >> And >> >> #define macro(x, y) function(x, y) >> >> is just the logical extension to that: There is nothing the expressions >> passed as arguments could contain to require parenthesization, as >> there's no operator of precedence lower than comma (and if either >> argument contains a comma expression, it needs to be >> parenthesized at the invocation site anyway). > > I think parenthesis are just long term guards against classic surprises > such as: > > #define macro(x) function(x * 2) > ... > macro(N + 3) There is no question that x needs to be parenthesized in the example you give; that does in no way mean _all_ macro parameters need to follow that, which is what my earlier reply was trying to explain. Jan