Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcde5b81 authored by Vijaya Mohan Guvva's avatar Vijaya Mohan Guvva Committed by James Bottomley
Browse files

[SCSI] bfa: Fix smatch warnings



Fixed following smatch warnings in bfa.
drivers/scsi/bfa/bfa_ioc.c:3882 bfa_sfp_show_comp() error: memcpy()
'des' too small (64 vs 248)
drivers/scsi/bfa/bfa_ioc.c:6859 bfa_flash_status_read() warn: unsigned
'status' is never less than zero.
drivers/scsi/bfa/bfa_ioc.c:6881 bfa_flash_status_read() warn: unsigned
'status' is never less than zero.
drivers/scsi/bfa/bfa_ioc.c:6917 bfa_flash_read_start() warn: unsigned
'status' is never less than zero.
drivers/scsi/bfa/bfa_ioc.c:7043 bfa_flash_raw_read() warn: unsigned
'status' is never less than zero.

Signed-off-by: default avatarVijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent e39a8b4f
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -3878,7 +3878,7 @@ bfa_sfp_show_comp(struct bfa_sfp_s *sfp, struct bfi_mbmsg_s *msg)
		bfa_trc(sfp, sfp->data_valid);
		bfa_trc(sfp, sfp->data_valid);
		if (sfp->data_valid) {
		if (sfp->data_valid) {
			u32	size = sizeof(struct sfp_mem_s);
			u32	size = sizeof(struct sfp_mem_s);
			u8 *des = (u8 *) &(sfp->sfpmem->srlid_base);
			u8 *des = (u8 *) &(sfp->sfpmem);
			memcpy(des, sfp->dbuf_kva, size);
			memcpy(des, sfp->dbuf_kva, size);
		}
		}
		/*
		/*
@@ -6851,7 +6851,7 @@ static u32
bfa_flash_status_read(void __iomem *pci_bar)
bfa_flash_status_read(void __iomem *pci_bar)
{
{
	union bfa_flash_dev_status_reg_u	dev_status;
	union bfa_flash_dev_status_reg_u	dev_status;
	u32				status;
	int				status;
	u32			ret_status;
	u32			ret_status;
	int				i;
	int				i;


@@ -6899,7 +6899,7 @@ static u32
bfa_flash_read_start(void __iomem *pci_bar, u32 offset, u32 len,
bfa_flash_read_start(void __iomem *pci_bar, u32 offset, u32 len,
			 char *buf)
			 char *buf)
{
{
	u32 status;
	int status;


	/*
	/*
	 * len must be mutiple of 4 and not exceeding fifo size
	 * len must be mutiple of 4 and not exceeding fifo size
@@ -7021,7 +7021,8 @@ bfa_status_t
bfa_flash_raw_read(void __iomem *pci_bar, u32 offset, char *buf,
bfa_flash_raw_read(void __iomem *pci_bar, u32 offset, char *buf,
		       u32 len)
		       u32 len)
{
{
	u32 n, status;
	u32 n;
	int status;
	u32 off, l, s, residue, fifo_sz;
	u32 off, l, s, residue, fifo_sz;


	residue = len;
	residue = len;