Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Shen Lichuan <shenlichuan@vivo.com>,
	jdelvare@suse.com, linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	opensource.kernel@vivo.com
Subject: Re: [PATCH v1] hwmon: (sht15) Simplify with dev_err_probe()
Date: Sat, 31 Aug 2024 07:53:14 +0200	[thread overview]
Message-ID: <4792cf2f-1a53-428b-9760-9f8c506c34d7@kernel.org> (raw)
In-Reply-To: <20240830065443.31760-1-shenlichuan@vivo.com>

On 30/08/2024 08:54, Shen Lichuan wrote:
> Use dev_err_probe() to simplify the error path and unify a message
> template.
> 
> Using this helper is totally fine even if err is known to never
> be -EPROBE_DEFER.
> 
> The benefit compared to a normal dev_err() is the standardized format
> of the error code, it being emitted symbolically and the fact that
> the error code is returned which allows more compact error paths.
> 
> Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
> ---
>  drivers/hwmon/sht15.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
> index 494f9655f44f..cc3a46a9c68e 100644
> --- a/drivers/hwmon/sht15.c
> +++ b/drivers/hwmon/sht15.c
> @@ -942,11 +942,9 @@ static int sht15_probe(struct platform_device *pdev)
>  			data->supply_uv = voltage;
>  
>  		ret = regulator_enable(data->reg);
> -		if (ret != 0) {
> -			dev_err(&pdev->dev,
> -				"failed to enable regulator: %d\n", ret);
> -			return ret;
> -		}
> +		if (ret != 0)
> +			return dev_err_probe(&pdev->dev, ret,
> +					     "failed to enable regulator\n");

This is ridiculous patch created by some low quality automation without
any review and thoughts from vivo.com side.

You change something which cannot defer, while leaving out unchanged
other places which actually can defer and could benefit.

Stop spamming with such low quality patches.

Best regards,
Krzysztof


  reply	other threads:[~2024-08-31  5:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30  6:54 [PATCH v1] hwmon: (sht15) Simplify with dev_err_probe() Shen Lichuan
2024-08-31  5:53 ` Krzysztof Kozlowski [this message]
2024-08-31 19:35   ` Guenter Roeck

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=4792cf2f-1a53-428b-9760-9f8c506c34d7@kernel.org \
    --to=krzk@kernel.org \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=opensource.kernel@vivo.com \
    --cc=shenlichuan@vivo.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