From: Guenter Roeck <linux@roeck-us.net>
To: xinghuo.chen@foxmail.com
Cc: jdelvare@suse.com, linux-kernel@vger.kernel.org,
linux-hwmon@vger.kernel.org, jingfelix@hust.edu.cn
Subject: Re: [PATCH v2] hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe()
Date: Mon, 3 Mar 2025 06:04:48 -0800 [thread overview]
Message-ID: <4e8b32f8-4570-4630-bd0f-91e63cd33767@roeck-us.net> (raw)
In-Reply-To: <tencent_9AD8E7683EC29CAC97496B44F3F865BA070A@qq.com>
On Mon, Mar 03, 2025 at 07:57:33AM -0500, xinghuo.chen@foxmail.com wrote:
> From: Xinghuo Chen <xinghuo.chen@foxmail.com>
>
> The devm_memremap() function returns error pointers on error,
> it doesn't return NULL.
>
> Fixes: c7cefce03e69 ("hwmon: (xgene) access mailbox as RAM")
> Signed-off-by: Xinghuo Chen <xinghuo.chen@foxmail.com>
Applied.
Thanks,
Guenter
> ---
> v1 -> v2:
> Use IS_ERR_OR_NULL() instead of IS_ERR() as devm_ioremap()
> return NULL on error.
>
> Link to v1: https://lore.kernel.org/all/tencent_370DBB5BD8EF699EC030ACA74BCB440FFA0A@qq.com
> ---
> drivers/hwmon/xgene-hwmon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
> index 1e3bd129a922..7087197383c9 100644
> --- a/drivers/hwmon/xgene-hwmon.c
> +++ b/drivers/hwmon/xgene-hwmon.c
> @@ -706,7 +706,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
> goto out;
> }
>
> - if (!ctx->pcc_comm_addr) {
> + if (IS_ERR_OR_NULL(ctx->pcc_comm_addr)) {
> dev_err(&pdev->dev,
> "Failed to ioremap PCC comm region\n");
> rc = -ENOMEM;
prev parent reply other threads:[~2025-03-03 14:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 12:57 xinghuo.chen
2025-03-03 14:04 ` Guenter Roeck [this message]
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=4e8b32f8-4570-4630-bd0f-91e63cd33767@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=jingfelix@hust.edu.cn \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xinghuo.chen@foxmail.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
all inboxes | Powered by JetHome®