From: YueHaibing <yuehaibing@huawei.com>
To: <gregkh@linuxfoundation.org>, <laurent.pinchart@ideasonboard.com>,
<balbi@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH -next] usb: gadget: Remove dead branch code
Date: Wed, 23 Jan 2019 22:31:36 +0800 [thread overview]
Message-ID: <20190123143136.15704-1-yuehaibing@huawei.com> (raw)
'num' is a u8 variable, it never greater than 255,
So the if branch is dead code and can be removed.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/usb/gadget/function/uvc_configfs.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
index bc1e2af..8fe85cb 100644
--- a/drivers/usb/gadget/function/uvc_configfs.c
+++ b/drivers/usb/gadget/function/uvc_configfs.c
@@ -1570,10 +1570,6 @@ uvcg_uncompressed_##cname##_store(struct config_item *item, \
if (ret) \
goto end; \
\
- if (num > 255) { \
- ret = -EINVAL; \
- goto end; \
- } \
u->desc.aname = num; \
ret = len; \
end: \
@@ -1767,10 +1763,6 @@ uvcg_mjpeg_##cname##_store(struct config_item *item, \
if (ret) \
goto end; \
\
- if (num > 255) { \
- ret = -EINVAL; \
- goto end; \
- } \
u->desc.aname = num; \
ret = len; \
end: \
--
2.7.0
next reply other threads:[~2019-01-23 14:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 14:31 YueHaibing [this message]
2019-03-06 0:46 ` Laurent Pinchart
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=20190123143136.15704-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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
all inboxes | Powered by JetHome®