Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752662AbdFNQLS (ORCPT ); Wed, 14 Jun 2017 12:11:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:47306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752315AbdFNQLP (ORCPT ); Wed, 14 Jun 2017 12:11:15 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EE0C214E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Wed, 14 Jun 2017 11:11:10 -0500 From: Bjorn Helgaas To: Arvind Yadav Cc: kishon@ti.com, bhelgaas@google.com, linux-omap@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: dwc: dra7xx: Fix compilation warning. Message-ID: <20170614161110.GA4918@bhelgaas-glaptop.roam.corp.google.com> References: <9ec4f891371506238afa813227b4be90341fee88.1497338120.git.arvind.yadav.cs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9ec4f891371506238afa813227b4be90341fee88.1497338120.git.arvind.yadav.cs@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1802 Lines: 43 On Tue, Jun 13, 2017 at 12:48:24PM +0530, Arvind Yadav wrote: > drivers/pci/dwc/pci-dra7xx.c: In function ‘dra7xx_pcie_enable_msi_interrupts’: > drivers/pci/dwc/pci-dra7xx.c:177:7: warning: large integer implicitly truncated to unsigned type [-Woverflow] > ~LEG_EP_INTERRUPTS & ~MSI); > ^ > drivers/pci/dwc/pci-dra7xx.c: In function ‘dra7xx_pcie_enable_wrapper_interrupts’: > drivers/pci/dwc/pci-dra7xx.c:187:7: warning: large integer implicitly truncated to unsigned type [-Woverflow] > ~INTERRUPTS); > > Signed-off-by: Arvind Yadav > --- > drivers/pci/dwc/pci-dra7xx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c > index 8decf46..328d480 100644 > --- a/drivers/pci/dwc/pci-dra7xx.c > +++ b/drivers/pci/dwc/pci-dra7xx.c > @@ -174,7 +174,7 @@ static int dra7xx_pcie_establish_link(struct dw_pcie *pci) > static void dra7xx_pcie_enable_msi_interrupts(struct dra7xx_pcie *dra7xx) > { > dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_IRQSTATUS_MSI, > - ~LEG_EP_INTERRUPTS & ~MSI); > + (u32)~LEG_EP_INTERRUPTS & (u32)~MSI); Can you put the casts in the definitions of LEG_EP_INTERRUPTS, MSI, INTERRUPTS, etc., instead of at every use? > > dra7xx_pcie_writel(dra7xx, > PCIECTRL_DRA7XX_CONF_IRQENABLE_SET_MSI, > @@ -184,7 +184,7 @@ static void dra7xx_pcie_enable_msi_interrupts(struct dra7xx_pcie *dra7xx) > static void dra7xx_pcie_enable_wrapper_interrupts(struct dra7xx_pcie *dra7xx) > { > dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_IRQSTATUS_MAIN, > - ~INTERRUPTS); > + (u32)~INTERRUPTS); > dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_IRQENABLE_SET_MAIN, > INTERRUPTS); > } > -- > 1.9.1 >