From c5a5f4706077edfb818f4fd212a90dc6b59874a0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 15 Mar 2021 03:12:51 +0000 Subject: [PATCH] qla2xxx-32gbit: 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) Link: https://lore.kernel.org/r/YAkaaSrhn1mFqyHy@mwanda Acked-by: Saurav Kashyap Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen [ commit c750a9c9c59a85843d447910a27da21c5bcf600a upstream ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9356 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_dfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qla2x00t-32gbit/qla_dfs.c b/qla2x00t-32gbit/qla_dfs.c index a02ad8077..fd58c0db3 100644 --- a/qla2x00t-32gbit/qla_dfs.c +++ b/qla2x00t-32gbit/qla_dfs.c @@ -373,7 +373,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",