mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-scsi@vger.kernel.org, Alim Akhtar <alim.akhtar@samsung.com>,
	Allison Randal <allison@lohutok.net>,
	Arnd Bergmann <arnd@arndb.de>, Avri Altman <avri.altman@wdc.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E. J. Bottomley" <jejb@linux.ibm.com>,
	Kangjie Lu <kjlu@umn.edu>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Pedro Sousa <pedrom.sousa@synopsys.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Wei Li <liwei213@huawei.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] scsi: ufs-hisi: Use PTR_ERR_OR_ZERO() in ufs_hisi_get_resource()
Date: Sat, 7 Sep 2019 14:36:28 +0200	[thread overview]
Message-ID: <9e667f19-434e-ed30-78cb-9ddc6323c51e@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 7 Sep 2019 14:25:31 +0200

Simplify this function implementation by using a known function.

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/scsi/ufs/ufs-hisi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-hisi.c b/drivers/scsi/ufs/ufs-hisi.c
index f4d1dca962c4..a0ea57c19dbc 100644
--- a/drivers/scsi/ufs/ufs-hisi.c
+++ b/drivers/scsi/ufs/ufs-hisi.c
@@ -454,10 +454,7 @@ static int ufs_hisi_get_resource(struct ufs_hisi_host *host)
 	/* get resource of ufs sys ctrl */
 	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	host->ufs_sys_ctrl = devm_ioremap_resource(dev, mem_res);
-	if (IS_ERR(host->ufs_sys_ctrl))
-		return PTR_ERR(host->ufs_sys_ctrl);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(host->ufs_sys_ctrl);
 }

 static void ufs_hisi_set_pm_lvl(struct ufs_hba *hba)
--
2.23.0


             reply	other threads:[~2019-09-07 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-07 12:36 Markus Elfring [this message]
2019-09-11 12:55 ` 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=9e667f19-434e-ed30-78cb-9ddc6323c51e@web.de \
    --to=markus.elfring@web.de \
    --cc=alim.akhtar@samsung.com \
    --cc=allison@lohutok.net \
    --cc=arnd@arndb.de \
    --cc=avri.altman@wdc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liwei213@huawei.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=martin.petersen@oracle.com \
    --cc=pedrom.sousa@synopsys.com \
    --cc=stanley.chu@mediatek.com \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®