From: Jonathan Woithe <jwoithe@just42.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Darren Hart <dvhart@infradead.org>,
platform-driver-x86@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] fujitsu-laptop: simplify show_brightness_changed()
Date: Fri, 27 Feb 2015 08:34:03 +1030 [thread overview]
Message-ID: <20150226220403.GA658@marvin.atrad.com.au> (raw)
In-Reply-To: <20150226204143.GF6820@mwanda>
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@oracle.com>
I agree. Thanks for spotting this.
Acked-by: Jonathan Woithe <jwoithe@just42.net>
> 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,
prev parent reply other threads:[~2015-02-26 22:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 20:41 [patch] fujitsu-laptop: simplify show_brightness_changed() Dan Carpenter
2015-02-26 22:04 ` Jonathan Woithe [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=20150226220403.GA658@marvin.atrad.com.au \
--to=jwoithe@just42.net \
--cc=dan.carpenter@oracle.com \
--cc=dvhart@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=platform-driver-x86@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