mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Kazuhiro Abe <fj1078ii@aa.jp.fujitsu.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	Huisong Li <lihuisong@huawei.com>
Subject: Re: [PATCH] hwmon: (acpi_power_meter) Fix a check for the return value of read_domain_devices().
Date: Wed, 15 Jan 2025 06:20:05 -0800	[thread overview]
Message-ID: <ec1cb50c-0cb9-4d7a-af2e-2cb1a7b47129@roeck-us.net> (raw)
In-Reply-To: <20250115073532.3211000-1-fj1078ii@aa.jp.fujitsu.com>

On Wed, Jan 15, 2025 at 07:35:32AM +0000, Kazuhiro Abe wrote:
> After commit fabb1f813ec0 ("hwmon: (acpi_power_meter) Fix fail to load
> module on platform without _PMD method"),
> the acpi_power_meter driver fails to load if the platform has _PMD method.
> 
> To address this, add a check for successful read_domain_devices().
> Tested on Nvidia Grace machine.
> 
> Fixes: fabb1f813ec0 ("hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method")
> Signed-off-by: Kazuhiro Abe <fj1078ii@aa.jp.fujitsu.com>

Checkpatch says:

CHECK: Unnecessary parentheses around 'res != 0'
#108: FILE: drivers/hwmon/acpi_power_meter.c:685:
+	if ((res != 0) && (res != -ENODEV))

No need to resend, I'll fix that up while applying, but please keep it in mind
for the future.

Guenter

> ---
>  drivers/hwmon/acpi_power_meter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
> index 2f1c9d97ad21..dbf2c606fe15 100644
> --- a/drivers/hwmon/acpi_power_meter.c
> +++ b/drivers/hwmon/acpi_power_meter.c
> @@ -682,7 +682,7 @@ static int setup_attrs(struct acpi_power_meter_resource *resource)
>  
>  	/* _PMD method is optional. */
>  	res = read_domain_devices(resource);
> -	if (res != -ENODEV)
> +	if ((res != 0) && (res != -ENODEV))
>  		return res;
>  
>  	if (resource->caps.flags & POWER_METER_CAN_MEASURE) {

  reply	other threads:[~2025-01-15 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15  7:35 Kazuhiro Abe
2025-01-15 14:20 ` Guenter Roeck [this message]
2025-01-16  2:18   ` Kazuhiro Abe (Fujitsu)

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=ec1cb50c-0cb9-4d7a-af2e-2cb1a7b47129@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=fj1078ii@aa.jp.fujitsu.com \
    --cc=jdelvare@suse.com \
    --cc=lihuisong@huawei.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®