summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-03-03 09:06:54 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-03-20 10:07:16 +0100
commit32aeef4be60cfe5b96cda2d6ae88ae32ef015894 (patch)
treeda6b245e861332e16f5cea36d569a5efe39f6f45
parentabc68d30fb89c7b1d41179e24fa315f71d8ae540 (diff)
downloadbarebox-32aeef4be60cfe5b96cda2d6ae88ae32ef015894.tar.gz
usb: remove unnecessary variable
"tmp" is only used to store the size of the descriptor. The name is not very meaningful and "tmp" is not even used everywhere it could be used. Just replace by using sizeof() directly where needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/core/usb.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index ad1d78b..e5c80aa 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -309,7 +309,6 @@ static int usb_get_descriptor(struct usb_device *dev, unsigned char type,
int usb_new_device(struct usb_device *dev)
{
int err;
- int tmp;
void *buf;
struct usb_device_descriptor *desc;
struct usb_device *parent = dev->parent;
@@ -384,17 +383,16 @@ int usb_new_device(struct usb_device *dev)
mdelay(10); /* Let the SET_ADDRESS settle */
- tmp = sizeof(*dev->descriptor);
-
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
dev->descriptor, sizeof(*dev->descriptor));
- if (err < tmp) {
+ if (err < sizeof(*dev->descriptor)) {
if (err < 0)
dev_err(&dev->dev, "unable to get device descriptor (error=%d)\n",
err);
else
dev_err(&dev->dev, "USB device descriptor short read " \
- "(expected %i, got %i)\n", tmp, err);
+ "(expected %zu, got %i)\n",
+ sizeof(*dev->descriptor), err);
goto err_out;
}
/* correct le values */