RE: [PATCH] scsi: qla2xxx: remove unnecessary NULL check

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

 



Hi Dan,
Thanks for a patch.

> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Sent: Thursday, January 21, 2021 11:39 AM
> To: Nilesh Javali <njavali@xxxxxxxxxxx>
> Cc: GR-QLogic-Storage-Upstream <GR-QLogic-Storage-
> Upstream@xxxxxxxxxxx>; James E.J. Bottomley <jejb@xxxxxxxxxxxxx>; Martin
> K. Petersen <martin.petersen@xxxxxxxxxx>; linux-scsi@xxxxxxxxxxxxxxx;
> kernel-janitors@xxxxxxxxxxxxxxx
> Subject: [PATCH] scsi: qla2xxx: remove unnecessary NULL check
> 
> The list iterator can't be NULL so this check is not required.  Removing
> the check silences a Smatch warning about inconsistent NULL checking.
> 
>     drivers/scsi/qla2xxx/qla_dfs.c:371 qla_dfs_tgt_counters_show()
>     error: we previously assumed 'fcport' could be null (see line 372)
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
>  drivers/scsi/qla2xxx/qla_dfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c
> index ccce0eab844e..85bd0e468d43 100644
> --- a/drivers/scsi/qla2xxx/qla_dfs.c
> +++ b/drivers/scsi/qla2xxx/qla_dfs.c
> @@ -369,7 +369,7 @@ qla_dfs_tgt_counters_show(struct seq_file *s, void
> *unused)
>  	seq_puts(s, "\n");
> 
>  	list_for_each_entry(fcport, &vha->vp_fcports, list) {
> -		if (!fcport || !fcport->rport)
> +		if (!fcport->rport)
>  			continue;
> 
>  		seq_printf(s, "Target Num = %7d Link Down Count = %14lld\n",

Acked-by: Saurav Kashyap <skashyap@xxxxxxxxxxx"

Thanks,
~Saurav
> --
> 2.29.2







[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux