Re: [lsusb PATCH] Verbose flag in tree mode shows vendor and product name.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 13, 2011 at 03:37:44PM -0600, Dafydd Crosby wrote:
> Verbose flag in tree mode shows vendor and product name.
> When running `lsusb -tv`, devices should have the vendor and
> product name appended to the row.
> 
>  Signed-off-by: Dafydd Crosby <dtcrsby@xxxxxxxxx>
> 
> ---
>  devtree.c |   47 ++++++++++++++++++++++++++++++++++++++++-------
>  devtree.h |    2 +-
>  lsusb.c   |    2 +-
>  3 files changed, 42 insertions(+), 9 deletions(-)
> 
> diff --git a/devtree.c b/devtree.c
> index 69c93ac..12faeca 100644
> --- a/devtree.c
> +++ b/devtree.c
> @@ -58,6 +58,30 @@ static void freebus(struct usbbusnode *bus)
> 
>  /* ---------------------------------------------------------------------- */
> 
> +static int get_vendor_string(char *buf, size_t size, u_int16_t vid)
> +{
> +        const char *cp;
> +

You forgot to use tabs here and in the other new functions you created :(

> +        if (size < 1)
> +                return 0;
> +        *buf = 0;
> +        if (!(cp = names_vendor(vid)))
> +                return 0;
> +        return snprintf(buf, size, "%s", cp);
> +}
> +
> +static int get_product_string(char *buf, size_t size, u_int16_t vid,
> u_int16_t pid)

Patch is line-wrapped :(

Anyway, I hand edited these things, and applied the patch, but now get a
bunch of build warnings that were not there prior to your patch:

devtree.c: In function âget_vendor_stringâ:
devtree.c:68:2: warning: implicit declaration of function ânames_vendorâ
devtree.c:68:2: warning: nested extern declaration of ânames_vendorâ
devtree.c:68:11: warning: assignment makes pointer from integer without a cast
devtree.c: In function âget_product_stringâ:
devtree.c:80:2: warning: implicit declaration of function ânames_productâ
devtree.c:80:2: warning: nested extern declaration of ânames_productâ
devtree.c:80:11: warning: assignment makes pointer from integer without a cast

Please redo this patch so it builds clean, and actually works.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux