mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
usb: gadget: legacy: fix redundant initialization warnings
Fix the following cppcheck warnings:
drivers/usb/gadget/legacy/inode.c:1364:8: style: Redundant initialization for 'value'. The initialized value is overwritten$
value = -EOPNOTSUPP;
^
drivers/usb/gadget/legacy/inode.c:1331:15: note: value is initialized
int value = -EOPNOTSUPP;
^
drivers/usb/gadget/legacy/inode.c:1364:8: note: value is overwritten
value = -EOPNOTSUPP;
^
drivers/usb/gadget/legacy/inode.c:1817:8: style: Redundant initialization for 'value'. The initialized value is overwritten$
value = -EINVAL;
^
drivers/usb/gadget/legacy/inode.c:1787:18: note: value is initialized
ssize_t value = len, length = len;
^
drivers/usb/gadget/legacy/inode.c:1817:8: note: value is overwritten
value = -EINVAL;
^
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
This commit is contained in:
parent
0534d40160
commit
d13cce7579
|
|
@ -1361,7 +1361,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
|||
|
||||
req->buf = dev->rbuf;
|
||||
req->context = NULL;
|
||||
value = -EOPNOTSUPP;
|
||||
switch (ctrl->bRequest) {
|
||||
|
||||
case USB_REQ_GET_DESCRIPTOR:
|
||||
|
|
@ -1784,7 +1783,7 @@ static ssize_t
|
|||
dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
|
||||
{
|
||||
struct dev_data *dev = fd->private_data;
|
||||
ssize_t value = len, length = len;
|
||||
ssize_t value, length = len;
|
||||
unsigned total;
|
||||
u32 tag;
|
||||
char *kbuf;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user