linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: qcom: Fix warning generated due to the incorrect data type
@ 2021-11-24 14:04 Manivannan Sadhasivam
  2021-11-30  3:36 ` Bjorn Helgaas
  0 siblings, 1 reply; 6+ messages in thread
From: Manivannan Sadhasivam @ 2021-11-24 14:04 UTC (permalink / raw)
  To: lorenzo.pieralisi, bhelgaas
  Cc: svarbanov, bjorn.andersson, robh, linux-pci, linux-arm-msm,
	linux-kernel, Manivannan Sadhasivam, kernel test robot

Fix the below sparse warning due to the use of incorrect initializer
data type (u16) for bdf_be variable that receives the return value of
cpu_to_be16(). The correct type should be __be16.

sparse warnings: (new ones prefixed by >>)
>> drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned short [usertype] bdf_be @@     got restricted __be16 [usertype] @@
   drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse:     expected unsigned short [usertype] bdf_be
   drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse:     got restricted __be16 [usertype]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 8a7a300163e5..6c3b034e9946 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1312,7 +1312,7 @@ static int qcom_pcie_config_sid_sm8250(struct qcom_pcie *pcie)
 
 	/* Look for an available entry to hold the mapping */
 	for (i = 0; i < nr_map; i++) {
-		u16 bdf_be = cpu_to_be16(map[i].bdf);
+		__be16 bdf_be = cpu_to_be16(map[i].bdf);
 		u32 val;
 		u8 hash;
 
-- 
2.25.1


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

end of thread, other threads:[~2021-11-30 18:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 14:04 [PATCH] PCI: qcom: Fix warning generated due to the incorrect data type Manivannan Sadhasivam
2021-11-30  3:36 ` Bjorn Helgaas
2021-11-30  6:21   ` Manivannan Sadhasivam
2021-11-30 16:03     ` Bjorn Helgaas
2021-11-30 16:35       ` Sven Peter
2021-11-30 18:35       ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).