* [U-Boot] [PATCH] common/usb_storage.c: Clean up usb_storage_probe()
@ 2015-10-11 11:26 Tom Rini
2015-10-11 12:05 ` Bin Meng
2015-10-11 12:17 ` Marek Vasut
0 siblings, 2 replies; 4+ messages in thread
From: Tom Rini @ 2015-10-11 11:26 UTC (permalink / raw)
To: u-boot
We have the protocol and subclass variables which are used only in
disabled debug code. This code dates back to the initial git import and
seemingly dead code so remove it.
This was detected by Coverity (CID 131117)
Signed-off-by: Tom Rini <trini@konsulko.com>
---
common/usb_storage.c | 29 ++---------------------------
1 file changed, 2 insertions(+), 27 deletions(-)
diff --git a/common/usb_storage.c b/common/usb_storage.c
index b390310..1a1633f 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -1177,25 +1177,9 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
struct usb_endpoint_descriptor *ep_desc;
unsigned int flags = 0;
- int protocol = 0;
- int subclass = 0;
-
/* let's examine the device now */
iface = &dev->config.if_desc[ifnum];
-#if 0
- /* this is the place to patch some storage devices */
- debug("iVendor %X iProduct %X\n", dev->descriptor.idVendor,
- dev->descriptor.idProduct);
-
- if ((dev->descriptor.idVendor) == 0x066b &&
- (dev->descriptor.idProduct) == 0x0103) {
- debug("patched for E-USB\n");
- protocol = US_PR_CB;
- subclass = US_SC_UFI; /* an assumption */
- }
-#endif
-
if (dev->descriptor.bDeviceClass != 0 ||
iface->desc.bInterfaceClass != USB_CLASS_MASS_STORAGE ||
iface->desc.bInterfaceSubClass < US_SC_MIN ||
@@ -1215,17 +1199,8 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
ss->ifnum = ifnum;
ss->pusb_dev = dev;
ss->attention_done = 0;
-
- /* If the device has subclass and protocol, then use that. Otherwise,
- * take data from the specific interface.
- */
- if (subclass) {
- ss->subclass = subclass;
- ss->protocol = protocol;
- } else {
- ss->subclass = iface->desc.bInterfaceSubClass;
- ss->protocol = iface->desc.bInterfaceProtocol;
- }
+ ss->subclass = iface->desc.bInterfaceSubClass;
+ ss->protocol = iface->desc.bInterfaceProtocol;
/* set the handler pointers based on the protocol */
debug("Transport: ");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] common/usb_storage.c: Clean up usb_storage_probe()
2015-10-11 11:26 [U-Boot] [PATCH] common/usb_storage.c: Clean up usb_storage_probe() Tom Rini
@ 2015-10-11 12:05 ` Bin Meng
2015-10-11 12:24 ` Tom Rini
2015-10-11 12:17 ` Marek Vasut
1 sibling, 1 reply; 4+ messages in thread
From: Bin Meng @ 2015-10-11 12:05 UTC (permalink / raw)
To: u-boot
Hi Tom,
On Sun, Oct 11, 2015 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
> We have the protocol and subclass variables which are used only in
> disabled debug code. This code dates back to the initial git import and
> seemingly dead code so remove it.
>
> This was detected by Coverity (CID 131117)
Just out of curiosity, is this Coverity public available for the
community to use?
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
[snip]
Regards,
Bin
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] common/usb_storage.c: Clean up usb_storage_probe()
2015-10-11 11:26 [U-Boot] [PATCH] common/usb_storage.c: Clean up usb_storage_probe() Tom Rini
2015-10-11 12:05 ` Bin Meng
@ 2015-10-11 12:17 ` Marek Vasut
1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2015-10-11 12:17 UTC (permalink / raw)
To: u-boot
On Sunday, October 11, 2015 at 01:26:27 PM, Tom Rini wrote:
> We have the protocol and subclass variables which are used only in
> disabled debug code. This code dates back to the initial git import and
> seemingly dead code so remove it.
>
> This was detected by Coverity (CID 131117)
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Marek Vasut <marex@denx.de>
You want me to pick it for -next or do you plan this for master ?
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] common/usb_storage.c: Clean up usb_storage_probe()
2015-10-11 12:05 ` Bin Meng
@ 2015-10-11 12:24 ` Tom Rini
0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2015-10-11 12:24 UTC (permalink / raw)
To: u-boot
On Sun, Oct 11, 2015 at 08:05:11PM +0800, Bin Meng wrote:
> Hi Tom,
>
> On Sun, Oct 11, 2015 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
> > We have the protocol and subclass variables which are used only in
> > disabled debug code. This code dates back to the initial git import and
> > seemingly dead code so remove it.
> >
> > This was detected by Coverity (CID 131117)
>
> Just out of curiosity, is this Coverity public available for the
> community to use?
We are (and technically we've had this since May 2014) a community
project. The ELC-E talk about using coverity reminded me to go give
things a spin and see what comes out. Right now I'm trying to figure
out the best way to get coverage for all of our different build targets
or if we may have to just go with building sandbox only for maximal
coverage (and make use of something like CONFIG_COMPILE_TEST_ONLY from
the kernel).
There is a way to make all defects publically viewable but I don't know
if that's a great idea or not (I don't see anything super duper worrying
but I also haven't really triaged everything) but anyone from the
community can sign up and join the project.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151011/c6320eb7/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-11 12:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11 11:26 [U-Boot] [PATCH] common/usb_storage.c: Clean up usb_storage_probe() Tom Rini
2015-10-11 12:05 ` Bin Meng
2015-10-11 12:24 ` Tom Rini
2015-10-11 12:17 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox