From: Xiaomeng Tong <xiam0nd.tong@gmail.com>
To: jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: alim.akhtar@samsung.com, avri.altman@wdc.com,
daejun7.park@samsung.com, bvanassche@acm.org, beanhuo@micron.com,
keosung.park@samsung.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org,
Xiaomeng Tong <xiam0nd.tong@gmail.com>
Subject: [PATCH] ufs: remove an unneed NULL check on list iterator
Date: Sat, 19 Mar 2022 12:26:57 +0800 [thread overview]
Message-ID: <20220319042657.21835-1-xiam0nd.tong@gmail.com> (raw)
The list iterator is always non-NULL so it doesn't need to be checked.
Thus just remove the unnecessary NULL check.
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
---
drivers/scsi/ufs/ufshpb.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
index 2d36a0715..a3db0ad60 100644
--- a/drivers/scsi/ufs/ufshpb.c
+++ b/drivers/scsi/ufs/ufshpb.c
@@ -869,12 +869,6 @@ static struct ufshpb_region *ufshpb_victim_lru_info(struct ufshpb_lu *hpb)
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;
--
2.17.1
next reply other threads:[~2022-03-19 4:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-19 4:26 Xiaomeng Tong [this message]
2022-03-20 0:57 ` [PATCH] ufs: remove an unneed NULL check on list iterator Jakob Koschel
2022-03-20 4:57 ` Xiaomeng Tong
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=20220319042657.21835-1-xiam0nd.tong@gmail.com \
--to=xiam0nd.tong@gmail.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=daejun7.park@samsung.com \
--cc=jejb@linux.ibm.com \
--cc=keosung.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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.