mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ufs: remove an unneed NULL check on list iterator
@ 2022-03-19  4:26 Xiaomeng Tong
  2022-03-20  0:57 ` Jakob Koschel
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaomeng Tong @ 2022-03-19  4:26 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: alim.akhtar, avri.altman, daejun7.park, bvanassche, beanhuo,
	keosung.park, linux-scsi, linux-kernel, Xiaomeng Tong

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-20  4:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-19  4:26 [PATCH] ufs: remove an unneed NULL check on list iterator Xiaomeng Tong
2022-03-20  0:57 ` Jakob Koschel
2022-03-20  4:57   ` Xiaomeng Tong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®