mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: cgel.zte@gmail.com
Cc: markgross@kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] platform/x86: hp-wmi: simplify the return expression of platform_profile_omen_set()
Date: Fri, 6 May 2022 12:18:39 +0200	[thread overview]
Message-ID: <86b00878-7d53-90b1-0891-e004094dc8b3@redhat.com> (raw)
In-Reply-To: <20220505021919.54462-1-chi.minghao@zte.com.cn>

Hi,

On 5/5/22 04:19, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Simplify the return expression.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>

omen_thermal_profile_set(tp) returns the value of tp on
success which is not necessarily always 0, so this
patch is invalid.

Regards,

Hans



> ---
>  drivers/platform/x86/hp-wmi.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
> index 667f94bba905..9edb1f877189 100644
> --- a/drivers/platform/x86/hp-wmi.c
> +++ b/drivers/platform/x86/hp-wmi.c
> @@ -1119,7 +1119,7 @@ static int platform_profile_omen_get(struct platform_profile_handler *pprof,
>  static int platform_profile_omen_set(struct platform_profile_handler *pprof,
>  				     enum platform_profile_option profile)
>  {
> -	int err, tp, tp_version;
> +	int tp, tp_version;
>  
>  	tp_version = omen_get_thermal_policy_version();
>  
> @@ -1149,11 +1149,7 @@ static int platform_profile_omen_set(struct platform_profile_handler *pprof,
>  		return -EOPNOTSUPP;
>  	}
>  
> -	err = omen_thermal_profile_set(tp);
> -	if (err < 0)
> -		return err;
> -
> -	return 0;
> +	return omen_thermal_profile_set(tp);
>  }
>  
>  static int thermal_profile_get(void)


      reply	other threads:[~2022-05-06 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05  2:19 cgel.zte
2022-05-06 10:18 ` Hans de Goede [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=86b00878-7d53-90b1-0891-e004094dc8b3@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=zealci@zte.com.cn \
    /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®