From: zhong jiang <zhongjiang@huawei.com>
To: <kronos.it@gmail.com>, <jdelvare@suse.com>, <linux@roeck-us.net>
Cc: <linux-hwmon@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] hwmon: Use PTR_ERR_OR_ZERO instead of reimplementing its function
Date: Tue, 11 Sep 2018 20:03:37 +0800 [thread overview]
Message-ID: <1536667417-11718-1-git-send-email-zhongjiang@huawei.com> (raw)
PTR_ERR_OR_ZERO has implemented the same function. We prefer to use
inlined function rather than code-opened implementation.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/hwmon/asus_atk0110.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index a6636fe..a7cf008 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -1210,10 +1210,8 @@ static int atk_register_hwmon(struct atk_data *data)
data->hwmon_dev = hwmon_device_register_with_groups(dev, "atk0110",
data,
data->attr_groups);
- if (IS_ERR(data->hwmon_dev))
- return PTR_ERR(data->hwmon_dev);
- return 0;
+ return PTR_ERR_OR_ZERO(data->hwmon_dev);
}
static int atk_probe_if(struct atk_data *data)
--
1.7.12.4
next reply other threads:[~2018-09-11 12:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 12:03 zhong jiang [this message]
2018-09-16 0:43 [PATCH] hwmon: Use PTR_ERR_OR_ZERO instead of reimplementing its function Guenter Roeck
2018-09-16 14:56 ` zhong jiang
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=1536667417-11718-1-git-send-email-zhongjiang@huawei.com \
--to=zhongjiang@huawei.com \
--cc=jdelvare@suse.com \
--cc=kronos.it@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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 NNTP newsgroup(s).