asahi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Yu Liao <liaoyu15@huawei.com>
To: <marcan@marcan.st>, <sven@svenpeter.dev>, <alyssa@rosenzweig.io>,
	<asahi@lists.linux.dev>
Cc: <liaoyu15@huawei.com>, <liwei391@huawei.com>
Subject: [PATCH -next] soc: apple: rtkit: Use PTR_ERR_OR_ZERO() to simplify code
Date: Wed, 16 Aug 2023 09:44:49 +0800	[thread overview]
Message-ID: <20230816014449.2988332-1-liaoyu15@huawei.com> (raw)

Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.

Signed-off-by: Yu Liao <liaoyu15@huawei.com>
---
 drivers/soc/apple/rtkit.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
index d9f19dc99da5..9ad4f2bd05e9 100644
--- a/drivers/soc/apple/rtkit.c
+++ b/drivers/soc/apple/rtkit.c
@@ -706,9 +706,7 @@ static int apple_rtkit_request_mbox_chan(struct apple_rtkit *rtk)
 		rtk->mbox_chan =
 			mbox_request_channel(&rtk->mbox_cl, rtk->mbox_idx);
 
-	if (IS_ERR(rtk->mbox_chan))
-		return PTR_ERR(rtk->mbox_chan);
-	return 0;
+	return PTR_ERR_OR_ZERO(rtk->mbox_chan);
 }
 
 struct apple_rtkit *apple_rtkit_init(struct device *dev, void *cookie,
-- 
2.25.1


             reply	other threads:[~2023-08-16  1:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16  1:44 Yu Liao [this message]
2023-08-16  8:06 ` [PATCH -next] soc: apple: rtkit: Use PTR_ERR_OR_ZERO() to simplify code Eric Curtin

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=20230816014449.2988332-1-liaoyu15@huawei.com \
    --to=liaoyu15@huawei.com \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=liwei391@huawei.com \
    --cc=marcan@marcan.st \
    --cc=sven@svenpeter.dev \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).