From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] scsi: ufs: fix itnull.cocci warnings
Date: Thu, 24 Mar 2022 19:42:43 +0800 [thread overview]
Message-ID: <20220324114243.GA14353@140d7c4dc0e0> (raw)
In-Reply-To: <202203241927.8qLUOAYy-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Bart Van Assche <bvanassche@acm.org>
From: kernel test robot <lkp@intel.com>
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 <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
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 = 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;
next prev parent reply other threads:[~2022-03-24 11:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 11:50 [bvanassche:ufs-for-next 324/324] drivers/scsi/ufs-core/ufshpb.c:878:7-10: ERROR: iterator variable bound on line 877 cannot be NULL kernel test robot
2022-03-24 11:42 ` kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-03-26 8:35 [PATCH] scsi: ufs: fix itnull.cocci warnings Julia Lawall
2022-03-26 8:35 ` Julia Lawall
2021-04-29 20:53 Julia Lawall
2021-04-29 2:21 [PATCH v33 2/4] scsi: ufs: L2P map management for HPB read kernel test robot
2021-04-29 2:21 ` [PATCH] scsi: ufs: fix itnull.cocci warnings kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220324114243.GA14353@140d7c4dc0e0 \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.