From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0612906432026801037==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] scsi: ufs: fix itnull.cocci warnings Date: Thu, 24 Mar 2022 19:42:43 +0800 Message-ID: <20220324114243.GA14353@140d7c4dc0e0> In-Reply-To: <202203241927.8qLUOAYy-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============0612906432026801037== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-kernel(a)vger.kernel.org TO: Bart Van Assche From: kernel test robot drivers/scsi/ufs-core/ufshpb.c:878:7-10: ERROR: iterator variable bound on = line 877 cannot be NULL Many iterators have the property that the first argument is always bound to a real list element, never NULL. Semantic patch information: False positives arise for some iterators that do not have this property, or in cases when the loop cursor is reassigned. The latter should only happen when the matched code is on the way to a loop exit (break, goto, or return). Generated by: scripts/coccinelle/iterators/itnull.cocci Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://github.com/bvanassche/linux ufs-for-next head: b93e987f91a0c037fc4357107f5144110cd84d08 commit: b93e987f91a0c037fc4357107f5144110cd84d08 [324/324] scsi: ufs: Split= the drivers/scsi/ufs directory :::::: branch date: 11 hours ago :::::: commit date: 11 hours ago Please take the patch only if it's a positive warning. Thanks! drivers/scsi/ufs-core/ufshpb.c | 6 ------ 1 file changed, 6 deletions(-) --- a/drivers/scsi/ufs-core/ufshpb.c +++ b/drivers/scsi/ufs-core/ufshpb.c @@ -875,12 +875,6 @@ static struct ufshpb_region *ufshpb_vict struct ufshpb_region *rgn, *victim_rgn =3D NULL; = list_for_each_entry(rgn, &lru_info->lh_lru_rgn, list_lru_rgn) { - if (!rgn) { - dev_err(&hpb->sdev_ufs_lu->sdev_dev, - "%s: no region allocated\n", - __func__); - return NULL; - } if (ufshpb_check_srgns_issue_state(hpb, rgn)) continue; =20 --===============0612906432026801037==--