From: "Jan Beulich" Subject: Re: [PATCH 1/4] hvmloader: Fixup pci_write* macros Date: Mon, 15 Jun 2015 15:36:42 +0100 Message-ID: <557EFF1A0200007800084F56@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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <557EE198.1080303@one.verizon.com> 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: Don Slutz Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , Don Slutz , "xen-devel@lists.xen.org" , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 15.06.15 at 16:30, wrote: > On 06/15/15 10:19, Andrew Cooper wrote: >> On 15/06/15 15:15, Don Slutz wrote: >>> Signed-off-by: Don Slutz >>> CC: Don Slutz >> >> Fix how? It looks like you are bracketing val. >> > > If val is an expression, the macro most likely does the wrong thing. > > For example: > > pci_writeb(devfn, PCI_IO_BASE, addr >> PCI_IO_SHIFT); > > > is pci_write(devfn, reg, 1, (uint8_t)addr >> PCI_IO_SHIFT); which is not > correct. I would expect: > > pci_write(devfn, reg, 1, (uint8_t)(addr >> PCI_IO_SHIFT)); > >> This is an improvement, but please always be specific as to what is >> being fixed. >> > > Does: > > Improve pci_write* macros to act like a function does. > > scan better? How about simply "correctly parenthesize pci_write* macros"? Jan