On Thu, 24 Feb 2005, Greg KH wrote:

> diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> --- a/drivers/usb/storage/scsiglue.c  2005-02-24 11:14:55 -08:00
> +++ b/drivers/usb/storage/scsiglue.c  2005-02-24 11:14:55 -08:00
> @@ -356,9 +356,22 @@
>       SPRINTF("   Host scsi%d: usb-storage\n", hostptr->host_no);
>  
>       /* print product, vendor, and serial number strings */
> -     SPRINTF("       Vendor: %s\n", us->vendor);
> -     SPRINTF("      Product: %s\n", us->product);
> -     SPRINTF("Serial Number: %s\n", us->serial);
> +     if (us->pusb_dev->manufacturer)
> +             SPRINTF("       Vendor: %s\n", us->pusb_dev->manufacturer);
> +     else if (us->unusual_dev->vendorName)
> +             SPRINTF("       Vendor: %s\n", us->unusual_dev->vendorName);
> +     else
> +             SPRINTF("       Vendor: Unknown\n");

Since SPRINTF is a macro, here and below it would be cleaner and more 
efficient to do something like this:

        char *p;

        if (us->pusb_dev->manufacturer)
                p = us->pusb_dev->manufacturer;         
        else if (us->unusual_dev->vendorName);
                p = us->unusual_dev->vendorName;
        else
                p = "Unknown";
        SPRINTF("     Vendor: %s\n", p);

Alan Stern



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to