Re: [PATCH] qla2xxx: fix sparse warning in func qla24xx_build_scsi_type_6_iocbs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nilesh,

> Sparse warning reported,
>
> drivers/scsi/qla2xxx/qla_iocb.c: In function 'qla24xx_build_scsi_type_6_iocbs':
>>> drivers/scsi/qla2xxx/qla_iocb.c:594:29: warning: variable 'ha' set but not used [-Wunused-but-set-variable]
>      594 |         struct qla_hw_data *ha;
>          |                             ^~
>
> Define variable 'ha' before exiting the routine.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202308230757.VKMIztAB-lkp@xxxxxxxxx/
> Signed-off-by: Nilesh Javali <njavali@xxxxxxxxxxx>
> ---
>  drivers/scsi/qla2xxx/qla_iocb.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
> index 7fbd917f6e1f..0eb8df5ee73c 100644
> --- a/drivers/scsi/qla2xxx/qla_iocb.c
> +++ b/drivers/scsi/qla2xxx/qla_iocb.c
> @@ -591,8 +591,8 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,
>  	uint16_t tot_dsds)
>  {
>  	struct dsd64 *cur_dsd = NULL, *next_dsd;
> -	scsi_qla_host_t	*vha;
> -	struct qla_hw_data *ha;
> +	scsi_qla_host_t	*vha = sp->vha;
> +	struct qla_hw_data *ha = vha->hw;

It doesn't appear that either of these are used at all in that function.
What am I missing?

-- 
Martin K. Petersen	Oracle Linux Engineering



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux