Re: [patch] fujitsu-laptop: simplify show_brightness_changed()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 26, 2015 at 11:41:43PM +0300, Dan Carpenter wrote:
> ->brightness_changed is either 0 or 1, and never a negative.  We can
> just remove this code.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

I agree.  Thanks for spotting this.

Acked-by: Jonathan Woithe <jwoithe@xxxxxxxxxx>

> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index 2a9afa2..aa5ee98 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -444,14 +444,7 @@ static ssize_t
>  show_brightness_changed(struct device *dev,
>  			struct device_attribute *attr, char *buf)
>  {
> -
> -	int ret;
> -
> -	ret = fujitsu->brightness_changed;
> -	if (ret < 0)
> -		return ret;
> -
> -	return sprintf(buf, "%i\n", ret);
> +	return sprintf(buf, "%i\n", fujitsu->brightness_changed);
>  }
>  
>  static ssize_t show_lcd_level(struct device *dev,
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux