From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6240655128770093840==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] scsi: ufs: fix itnull.cocci warnings Date: Thu, 29 Apr 2021 10:21:53 +0800 Message-ID: <20210429022153.GA14534@5835d54b1b90> In-Reply-To: <202104290917.KB4aVVR3-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============6240655128770093840== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org In-Reply-To: <20210428075716epcms2p2b2f54411913a85d40735e061434ffaf5@epcm= s2p2> References: <20210428075716epcms2p2b2f54411913a85d40735e061434ffaf5@epcms= 2p2> TO: Daejun Park TO: Daejun Park TO: Greg KH TO: "avri.altman" TO: jejb TO: "martin.petersen" TO: asutoshd TO: "stanley.chu" TO: cang TO: bvanassche TO: huobean From: kernel test robot drivers/scsi/ufs/ufshpb.c:406:7-10: ERROR: iterator variable bound on line = 405 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 CC: Daejun Park Reported-by: kernel test robot Signed-off-by: kernel test robot --- url: https://github.com/0day-ci/linux/commits/Daejun-Park/scsi-ufs-Intro= duce-HPB-feature/20210428-155927 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-ne= xt :::::: branch date: 18 hours ago :::::: commit date: 18 hours ago Please take the patch only if it's a positive warning. Thanks! ufshpb.c | 6 ------ 1 file changed, 6 deletions(-) --- a/drivers/scsi/ufs/ufshpb.c +++ b/drivers/scsi/ufs/ufshpb.c @@ -403,12 +403,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 --===============6240655128770093840==--