From: rickard_strandqvist@spectrumdigital.se (Rickard Strandqvist)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mfd: ab8500-debugfs.c: Cleaning up unnecessary to test, unsigned can't be negative.
Date: Sat, 28 Jun 2014 23:34:38 +0200 [thread overview]
Message-ID: <1403991279-7109-1-git-send-email-rickard_strandqvist@spectrumdigital.se> (raw)
Unsigned variable can't be negative so it is unnecessary to test it
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/mfd/ab8500-debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index d1a22aa..0793a10 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -2504,7 +2504,7 @@ static ssize_t ab8500_gpadc_trig_timer_write(struct file *file,
if (err)
return err;
- if ((user_trig_timer >= 0) && (user_trig_timer <= 255)) {
+ if (user_trig_timer <= 255) {
trig_timer = (u8) user_trig_timer;
} else {
dev_err(dev, "debugfs error input: "
--
1.7.10.4
next reply other threads:[~2014-06-28 21:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-28 21:34 Rickard Strandqvist [this message]
2014-07-02 6:54 ` [PATCH] mfd: ab8500-debugfs.c: Cleaning up unnecessary to test, unsigned can't be negative 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=1403991279-7109-1-git-send-email-rickard_strandqvist@spectrumdigital.se \
--to=rickard_strandqvist@spectrumdigital.se \
--cc=linux-arm-kernel@lists.infradead.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