]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: gadget: Remove dead branch code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 23 Jan 2019 14:31:36 +0000 (22:31 +0800)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 28 Jan 2019 10:51:29 +0000 (12:51 +0200)
'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>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/uvc_configfs.c

index bc1e2af566c347cde135bba74a52470f399430e4..8fe85cb4e87e8af5a4f3a3e343a2da0feeedccd3 100644 (file)
@@ -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:                                                                   \