public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alim Akhtar <alim.akhtar@samsung.com>,
	Bart Van Assche <bvanassche@acm.org>
Cc: Avri Altman <avri.altman@wdc.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Daejun Park <daejun7.park@samsung.com>,
	Bean Huo <beanhuo@micron.com>,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] scsi: ufs: clean up ufshpb_check_hpb_reset_query()
Date: Tue, 31 May 2022 10:29:38 +0300	[thread overview]
Message-ID: <YpXD4nLc4iCxpw91@kili> (raw)

Smatch complains that the if (flag_res) is not required:

    drivers/ufs/core/ufshpb.c:2306 ufshpb_check_hpb_reset_query()
    warn: duplicate check 'flag_res' (previous on line 2301)

Re-write the "if (flag_res)" checking to be more clear.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/ufs/core/ufshpb.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/ufs/core/ufshpb.c b/drivers/ufs/core/ufshpb.c
index fb122eaed28b..95b501b824df 100644
--- a/drivers/ufs/core/ufshpb.c
+++ b/drivers/ufs/core/ufshpb.c
@@ -2299,17 +2299,15 @@ static bool ufshpb_check_hpb_reset_query(struct ufs_hba *hba)
 		}
 
 		if (!flag_res)
-			goto out;
+			return false;
 
 		usleep_range(1000, 1100);
 	}
-	if (flag_res) {
-		dev_err(hba->dev,
-			"%s fHpbReset was not cleared by the device\n",
-			__func__);
-	}
-out:
-	return flag_res;
+
+	dev_err(hba->dev,
+		"%s fHpbReset was not cleared by the device\n",
+		__func__);
+	return true;
 }
 
 /**
-- 
2.35.1


             reply	other threads:[~2022-05-31  7:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31  7:29 Dan Carpenter [this message]
2022-06-01  6:25 ` [PATCH] scsi: ufs: clean up ufshpb_check_hpb_reset_query() Avri Altman
2022-06-01  7:09   ` Dan Carpenter
2022-06-01  7:14     ` Avri Altman

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=YpXD4nLc4iCxpw91@kili \
    --to=dan.carpenter@oracle.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=kernel-janitors@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox