From: "Bernat, Yehezkel" <yehezkel.bernat@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andreas Noever <andreas.noever@gmail.com>,
Michael Jamet <michael.jamet@intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Lukas Wunner <lukas@wunner.de>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] thunderbolt: Remove superfluous check
Date: Tue, 15 Aug 2017 08:19:01 +0300 [thread overview]
Message-ID: <29cf6caa-07a9-9c52-bd8c-6634749f99ca@intel.com> (raw)
The key size is tested by hex2bin() already (as '\0' isn't an hex digit)
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
---
drivers/thunderbolt/switch.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index e9391bb..69fde0b 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -808,9 +808,6 @@ static ssize_t key_store(struct device *dev, struct device_attribute *attr,
u8 key[TB_SWITCH_KEY_SIZE];
ssize_t ret = count;
- if (count < 64)
- return -EINVAL;
-
if (hex2bin(key, buf, sizeof(key)))
return -EINVAL;
--
2.7.4
next reply other threads:[~2017-08-15 5:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 5:19 Bernat, Yehezkel [this message]
2017-08-15 7:02 ` Mika Westerberg
2017-08-27 13:31 ` Mika Westerberg
2017-08-28 14:20 ` Greg Kroah-Hartman
2017-08-30 14:00 ` Bernat, Yehezkel
2017-08-30 14:25 ` gregkh
2017-08-15 9:32 ` Andy Shevchenko
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=29cf6caa-07a9-9c52-bd8c-6634749f99ca@intel.com \
--to=yehezkel.bernat@intel.com \
--cc=andreas.noever@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=michael.jamet@intel.com \
--cc=mika.westerberg@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®