All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Artur Weber <aweber.kernel@gmail.com>
Cc: Daniel Thompson <daniel.thompson@linaro.org>,
	kernel test robot <lkp@intel.com>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
	Lee Jones <lee@kernel.org>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] backlight: lp855x: Drop ret variable in brightness change function
Date: Tue, 15 Aug 2023 12:09:10 -0700	[thread overview]
Message-ID: <20230815190910.GA2908446@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230809114216.4078-1-aweber.kernel@gmail.com>

On Wed, Aug 09, 2023 at 01:42:16PM +0200, Artur Weber wrote:
> Fixes the following warning:
> 
> drivers/video/backlight/lp855x_bl.c:252:7: warning: variable 'ret' is used
> uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> 
> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
> Fixes: 5145531be5fb ("backlight: lp855x: Catch errors when changing brightness")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202308091728.NEJhgUPP-lkp@intel.com/

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  drivers/video/backlight/lp855x_bl.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index 61a7f45bfad8..da1f124db69c 100644
> --- a/drivers/video/backlight/lp855x_bl.c
> +++ b/drivers/video/backlight/lp855x_bl.c
> @@ -241,19 +241,17 @@ static int lp855x_bl_update_status(struct backlight_device *bl)
>  {
>  	struct lp855x *lp = bl_get_data(bl);
>  	int brightness = bl->props.brightness;
> -	int ret;
>  
>  	if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
>  		brightness = 0;
>  
>  	if (lp->mode == PWM_BASED)
> -		ret = lp855x_pwm_ctrl(lp, brightness,
> +		return lp855x_pwm_ctrl(lp, brightness,
>  				      bl->props.max_brightness);
>  	else if (lp->mode == REGISTER_BASED)
> -		ret = lp855x_write_byte(lp, lp->cfg->reg_brightness,
> +		return lp855x_write_byte(lp, lp->cfg->reg_brightness,
>  					(u8)brightness);
> -
> -	return ret;
> +	return -EINVAL;
>  }
>  
>  static const struct backlight_ops lp855x_bl_ops = {
> 
> base-commit: 21ef7b1e17d039053edaeaf41142423810572741
> -- 
> 2.41.0
> 

WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <nathan@kernel.org>
To: Artur Weber <aweber.kernel@gmail.com>
Cc: Lee Jones <lee@kernel.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] backlight: lp855x: Drop ret variable in brightness change function
Date: Tue, 15 Aug 2023 12:09:10 -0700	[thread overview]
Message-ID: <20230815190910.GA2908446@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230809114216.4078-1-aweber.kernel@gmail.com>

On Wed, Aug 09, 2023 at 01:42:16PM +0200, Artur Weber wrote:
> Fixes the following warning:
> 
> drivers/video/backlight/lp855x_bl.c:252:7: warning: variable 'ret' is used
> uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> 
> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
> Fixes: 5145531be5fb ("backlight: lp855x: Catch errors when changing brightness")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202308091728.NEJhgUPP-lkp@intel.com/

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  drivers/video/backlight/lp855x_bl.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index 61a7f45bfad8..da1f124db69c 100644
> --- a/drivers/video/backlight/lp855x_bl.c
> +++ b/drivers/video/backlight/lp855x_bl.c
> @@ -241,19 +241,17 @@ static int lp855x_bl_update_status(struct backlight_device *bl)
>  {
>  	struct lp855x *lp = bl_get_data(bl);
>  	int brightness = bl->props.brightness;
> -	int ret;
>  
>  	if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
>  		brightness = 0;
>  
>  	if (lp->mode == PWM_BASED)
> -		ret = lp855x_pwm_ctrl(lp, brightness,
> +		return lp855x_pwm_ctrl(lp, brightness,
>  				      bl->props.max_brightness);
>  	else if (lp->mode == REGISTER_BASED)
> -		ret = lp855x_write_byte(lp, lp->cfg->reg_brightness,
> +		return lp855x_write_byte(lp, lp->cfg->reg_brightness,
>  					(u8)brightness);
> -
> -	return ret;
> +	return -EINVAL;
>  }
>  
>  static const struct backlight_ops lp855x_bl_ops = {
> 
> base-commit: 21ef7b1e17d039053edaeaf41142423810572741
> -- 
> 2.41.0
> 

  parent reply	other threads:[~2023-08-15 19:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 11:42 [PATCH] backlight: lp855x: Drop ret variable in brightness change function Artur Weber
2023-08-09 11:42 ` Artur Weber
2023-08-09 16:38 ` Daniel Thompson
2023-08-09 16:38   ` Daniel Thompson
2023-08-15 19:09 ` Nathan Chancellor [this message]
2023-08-15 19:09   ` Nathan Chancellor
2023-08-18 15:38 ` (subset) " Lee Jones
2023-08-18 15:38   ` Lee Jones

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=20230815190910.GA2908446@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=aweber.kernel@gmail.com \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.