Skip to contentSkip to conversation

usb: Remove unused variable in usb_setup_descriptor()

PATCH New Hans de Goede 3 participants 5 messages Apr 19, 2015 – Apr 21, 2015

lore
Share & tools
lore
#0 lore raw

cover usb: Remove unused variable in usb_setup_descriptor()

Hi All,

Note this applies on top of the V3 dm pull request Simon send yesterday.

Regards,

Hans

#1 lore raw

PATCH 1/1 usb: Remove unused variable in usb_setup_descriptor()

The compiler did not catch this as it was marked __maybe_unused.

---
 common/usb.c | 2 --
 1 file changed, 2 deletions(-)
common/usb.c +0 -2
index a4820d3..305d5cf 100644
@@ -931,8 +931,6 @@ static int get_descriptor_len(struct usb_device *dev, int len, int expect_len)
 
 static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
 {
-	__maybe_unused struct usb_device_descriptor *desc;
-
 	/*
 	 * This is a Windows scheme of initialization sequence, with double
 	 * reset of the device (Linux uses the same sequence)
Signature · 1 line
2.3.5
#2 lore raw

PATCH 1/1 usb: Remove unused variable in usb_setup_descriptor()

Hi Hans,

Quoted 6 lines · Hans de Goede

The compiler did not catch this as it was marked __maybe_unused.

---
 common/usb.c | 2 --
 1 file changed, 2 deletions(-)

Thanks for spotting this. Another minor problem is that get_descriptor_len() allocates a 512-byte buffer but only 64 bytes is needed.

Regards,
Simon

#3 lore raw

PATCH 1/1 usb: Remove unused variable in usb_setup_descriptor()

Hi,

Quoted 10 lines · Simon Glass

Hi Hans,

Quoted 6 lines · Hans de Goede

The compiler did not catch this as it was marked __maybe_unused.

---
  common/usb.c | 2 --
  1 file changed, 2 deletions(-)
Quoted 5 lines

Thanks for spotting this. Another minor problem is that get_descriptor_len() allocates a 512-byte buffer but only 64 bytes is needed.

Good one, someone should probably write a patch for this. Consider such a patch Acked-by: Hans de Goede <[email protected]> .

Whom is going to pick up these fixes and upstream them ?

Regards,

Hans

#4 lore raw

PATCH 1/1 usb: Remove unused variable in usb_setup_descriptor()

Quoted 16 lines · Hans de Goede

Hi,

Quoted 13 lines · Simon Glass

Hi Hans,

Quoted 7 lines · Hans de Goede

The compiler did not catch this as it was marked __maybe_unused.

---

  common/usb.c | 2 --
  1 file changed, 2 deletions(-)
Quoted 8 lines
Quoted 3 lines

Thanks for spotting this. Another minor problem is that get_descriptor_len() allocates a 512-byte buffer but only 64 bytes is needed.

Good one, someone should probably write a patch for this. Consider such a patch Acked-by: Hans de Goede <[email protected]> .

Whom is going to pick up these fixes and upstream them ?

Applied to u-boot-usb/master, thanks!

Best regards,
Marek Vasut