All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [-next] PCI: DWC: Fix cast truncates bits from constant value
@ 2020-09-22  9:59 Gustavo Pimentel
  2020-09-22 16:57 ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: Gustavo Pimentel @ 2020-09-22  9:59 UTC (permalink / raw)
  To: linux-pci, bhelgaas; +Cc: Gustavo Pimentel, Joao Pinto

Fixes warning given by executing "make C=2 drivers/pci/"

Sparse output:
CHECK drivers/pci/controller/dwc/pcie-designware.c
 drivers/pci/controller/dwc/pcie-designware.c:432:52: warning:
 cast truncates bits from constant value (ffffffff7fffffff becomes
 7fffffff)

Reported-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
---
 drivers/pci/controller/dwc/pcie-designware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 3c3a4d1..e7a41d9 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -429,7 +429,7 @@ void dw_pcie_disable_atu(struct dw_pcie *pci, int index,
 	}
 
 	dw_pcie_writel_dbi(pci, PCIE_ATU_VIEWPORT, region | index);
-	dw_pcie_writel_dbi(pci, PCIE_ATU_CR2, (u32)~PCIE_ATU_ENABLE);
+	dw_pcie_writel_dbi(pci, PCIE_ATU_CR2, ~(u32)PCIE_ATU_ENABLE);
 }
 
 int dw_pcie_wait_for_link(struct dw_pcie *pci)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] [-next] PCI: DWC: Fix cast truncates bits from constant value
@ 2020-09-17 21:28 Gustavo Pimentel
  2020-09-17 21:47 ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: Gustavo Pimentel @ 2020-09-17 21:28 UTC (permalink / raw)
  To: linux-pci, bhelgaas; +Cc: Gustavo Pimentel, Joao Pinto

Fixes warning given by executing "make C=2 drivers/pci/"

Sparse output:
CHECK drivers/pci/controller/dwc/pcie-designware.c
 drivers/pci/controller/dwc/pcie-designware.c:432:52: warning:
 cast truncates bits from constant value (ffffffff7fffffff becomes
 7fffffff)

Reported-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
---
 drivers/pci/controller/dwc/pcie-designware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 3c3a4d1..dcb7108 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -429,7 +429,7 @@ void dw_pcie_disable_atu(struct dw_pcie *pci, int index,
 	}
 
 	dw_pcie_writel_dbi(pci, PCIE_ATU_VIEWPORT, region | index);
-	dw_pcie_writel_dbi(pci, PCIE_ATU_CR2, (u32)~PCIE_ATU_ENABLE);
+	dw_pcie_writel_dbi(pci, PCIE_ATU_CR2, (u32)~0 & ~PCIE_ATU_ENABLE);
 }
 
 int dw_pcie_wait_for_link(struct dw_pcie *pci)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-28 11:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22  9:59 [PATCH] [-next] PCI: DWC: Fix cast truncates bits from constant value Gustavo Pimentel
2020-09-22 16:57 ` Bjorn Helgaas
2020-09-28 11:42   ` Lorenzo Pieralisi
  -- strict thread matches above, loose matches on Subject: below --
2020-09-17 21:28 Gustavo Pimentel
2020-09-17 21:47 ` Bjorn Helgaas
2020-09-18  7:15   ` Gustavo Pimentel
2020-09-21 11:30     ` Gustavo Pimentel
2020-09-21 16:36       ` Bjorn Helgaas
2020-09-22  9:57         ` Gustavo Pimentel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.