netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] csiostor:fix sparse warnings
@ 2015-01-09 15:55 Praveen Madhavan
  2015-01-12  5:40 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Praveen Madhavan @ 2015-01-09 15:55 UTC (permalink / raw)
  To: netdev, linux-scsi; +Cc: davem, JBottomley, hch, hariprasad, praveenm

This patch fixes sparse warning reported by kbuild.
Apply this on net-next since it depends on previous commit.

drivers/scsi/csiostor/csio_hw.c:259:17: sparse: cast to restricted __le32
drivers/scsi/csiostor/csio_hw.c:536:31: sparse: incorrect type in assignment
(different base types)
drivers/scsi/csiostor/csio_hw.c:536:31:    expected unsigned int [unsigned]
[usertype] <noident>
drivers/scsi/csiostor/csio_hw.c:536:31:    got restricted __be32 [usertype]
<noident>
>> drivers/scsi/csiostor/csio_hw.c:2012:5: sparse: symbol 'csio_hw_prep_fw' was
not declared. Should it be static?

Signed-off-by: Praveen Madhavan <praveenm@chelsio.com>
---
 drivers/scsi/csiostor/csio_hw.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index b70c15f..5c31fa6 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -256,7 +256,7 @@ csio_hw_seeprom_read(struct csio_hw *hw, uint32_t addr, uint32_t *data)
 	}
 
 	pci_read_config_dword(hw->pdev, base + PCI_VPD_DATA, data);
-	*data = le32_to_cpu(*data);
+	*data = le32_to_cpu(*(__le32 *)data);
 
 	return 0;
 }
@@ -533,7 +533,7 @@ csio_hw_read_flash(struct csio_hw *hw, uint32_t addr, uint32_t nwords,
 		if (ret)
 			return ret;
 		if (byte_oriented)
-			*data = htonl(*data);
+			*data = (__force __u32) htonl(*data);
 	}
 	return 0;
 }
@@ -2009,7 +2009,7 @@ static struct fw_info *find_fw_info(int chip)
 	return NULL;
 }
 
-int csio_hw_prep_fw(struct csio_hw *hw, struct fw_info *fw_info,
+static int csio_hw_prep_fw(struct csio_hw *hw, struct fw_info *fw_info,
 	       const u8 *fw_data, unsigned int fw_size,
 	       struct fw_hdr *card_fw, enum csio_dev_state state,
 	       int *reset)
-- 
2.0.2


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

* Re: [PATCH 1/1] csiostor:fix sparse warnings
  2015-01-09 15:55 [PATCH 1/1] csiostor:fix sparse warnings Praveen Madhavan
@ 2015-01-12  5:40 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-01-12  5:40 UTC (permalink / raw)
  To: praveenm; +Cc: netdev, linux-scsi, JBottomley, hch, hariprasad

From: Praveen Madhavan <praveenm@chelsio.com>
Date: Fri,  9 Jan 2015 21:25:16 +0530

> This patch fixes sparse warning reported by kbuild.
> Apply this on net-next since it depends on previous commit.
> 
> drivers/scsi/csiostor/csio_hw.c:259:17: sparse: cast to restricted __le32
> drivers/scsi/csiostor/csio_hw.c:536:31: sparse: incorrect type in assignment
> (different base types)
> drivers/scsi/csiostor/csio_hw.c:536:31:    expected unsigned int [unsigned]
> [usertype] <noident>
> drivers/scsi/csiostor/csio_hw.c:536:31:    got restricted __be32 [usertype]
> <noident>
>>> drivers/scsi/csiostor/csio_hw.c:2012:5: sparse: symbol 'csio_hw_prep_fw' was
> not declared. Should it be static?
> 
> Signed-off-by: Praveen Madhavan <praveenm@chelsio.com>

Applied, thanks.

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

end of thread, other threads:[~2015-01-12  5:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-09 15:55 [PATCH 1/1] csiostor:fix sparse warnings Praveen Madhavan
2015-01-12  5:40 ` David Miller

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).