From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jonathan Woithe <jwoithe@just42.net>
Cc: Darren Hart <dvhart@infradead.org>,
platform-driver-x86@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [patch] fujitsu-laptop: simplify show_brightness_changed()
Date: Thu, 26 Feb 2015 23:41:43 +0300 [thread overview]
Message-ID: <20150226204143.GF6820@mwanda> (raw)
->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>
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,
next reply other threads:[~2015-02-26 20:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 20:41 Dan Carpenter [this message]
2015-02-26 22:04 ` [patch] fujitsu-laptop: simplify show_brightness_changed() Jonathan Woithe
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=20150226204143.GF6820@mwanda \
--to=dan.carpenter@oracle.com \
--cc=dvhart@infradead.org \
--cc=jwoithe@just42.net \
--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