diff options
author | Jacob Garber <jgarber1@ualberta.ca> | 2019-05-24 17:34:23 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-28 21:11:12 -0700 |
commit | 79cbf4df7fc9dbe80a4b88f93e83dcc323e3ed70 (patch) | |
tree | dc06a72dc23975f34dfe140ef8da1af8f30260c5 | |
parent | d54a230e9e9bf9ee83cd7022a03dffadd6d98e9a (diff) | |
download | chrome-ec-79cbf4df7fc9dbe80a4b88f93e83dcc323e3ed70.tar.gz |
common: Remove duplicate error check
This argument count check is already performed at the beginning of the
function and is useless anyway since we've already accessed argv[1].
BUG=none
BRANCH=none
TEST=none
Change-Id: I9f1de3c5e67bb0db5564d8a1161b2ae646e8dfe9
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 141743
Reviewed-on: https://chromium-review.googlesource.com/1629277
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | common/usb_pd_protocol.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 04b3b5223b..74666fef98 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -4852,9 +4852,7 @@ static int command_pd(int argc, char **argv) else if (!strncasecmp(argv[1], "trysrc", 6)) { int enable; - if (argc < 2) { - return EC_ERROR_PARAM_COUNT; - } else if (argc >= 3) { + if (argc >= 3) { enable = strtoi(argv[2], &e, 10); if (*e) return EC_ERROR_PARAM3; |