Received: by 10.213.65.68 with SMTP id h4csp1310791imn; Sat, 24 Mar 2018 09:07:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELvkVx64bjAHkS/zi9jsuorHYoNIZrWrWnbQ8lvei36Vn+jxV/rx3VGTe3BOYO01T+REd+d3 X-Received: by 10.99.143.3 with SMTP id n3mr9255329pgd.136.1521907652140; Sat, 24 Mar 2018 09:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521907652; cv=none; d=google.com; s=arc-20160816; b=L5ziPRJq5hdCPmaFS5wBgupVAeLPMTn2U61DOpo5b7jzbHV78KtMtY5FZGFTBMq0ZA SX3+ejkHvazbAzAmBbckQGZqSec0hbRM2zL1MuAKMxsXvJsjeOOw6WT9AOD2wvWTbrkL 2sqtAKHyB1cLzvfG7yAWYNeMJX4uGVe0DDNd6tQaqGFmr0wa4+r3C7Op+J9ItczJxf/V Ca4dSc/MYDmMr4j1xTC2Om0eO8lyjcjaPsRAKvQddCrIgUXQ9G+Q4PtSWTFVmQsm/SWP HvHCP9AxwSSnyojAMq6VK3G0JhxXnfcnzG/xgASp9k34uy8kQrVwxGghq9Lne1o3mIhJ zFwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=sD2+6jw5nDiUOo6IMgnFkgWz+TX9Dq+5AW7AdmaUzvM=; b=IPbCz4i/lGX18GJlt4W14dbbeZDxZK0OZIW4rmBXWT4yzq1oy4ExyN3PDoxtA6pYm6 4fuMlE6LChfmu6xyNlPHpcxOEHfemWO3/1jnsaI+gDt6/Kk6ASWGch/SpHjgVovWl3ZC k1VToH4HhIho6IkgS9qrCiN1vOXlcZqpedEAY0+fMPMnJxsmyO7ie7jLNXcXQOUJEs0I bpTCYLT86r85fyhBQdZYuteCCCt7TldaTBAv98ko3GM2rlzxQDcesxRddJPKbUDXRFA1 nWwryNlZH0gDXTa4RuwtGhpoYEOHdEx1yXZMb4lB3AZuaaMKE9rLJpGgXMiAXqaXv+Lg r5zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si1879729pld.396.2018.03.24.09.07.17; Sat, 24 Mar 2018 09:07:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752439AbeCXQGW (ORCPT + 99 others); Sat, 24 Mar 2018 12:06:22 -0400 Received: from netrider.rowland.org ([192.131.102.5]:50729 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752095AbeCXQGV (ORCPT ); Sat, 24 Mar 2018 12:06:21 -0400 Received: (qmail 31015 invoked by uid 500); 24 Mar 2018 12:06:20 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 24 Mar 2018 12:06:20 -0400 Date: Sat, 24 Mar 2018 12:06:20 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Benson Leung cc: gregkh@linuxfoundation.org, , , , Subject: Re: [PATCH v2] USB: announce bcdDevice as well as idVendor, idProduct. In-Reply-To: <20180324013154.230119-1-bleung@chromium.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Mar 2018, Benson Leung wrote: > Print bcdDevice which is used by vendors to identify different versions > of the same product (or different versions of firmware). > > Adding this to the logs will be useful for support purposes. > > Match the %2x.%02x formatting that's used by lsusb -v for this same value. > > Signed-off-by: Benson Leung > -- > v2: Format for decimal output. > --- > drivers/usb/core/hub.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index aaeef03c0d83..624cde7ffcea 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -2192,14 +2192,19 @@ static void show_string(struct usb_device *udev, char *id, char *string) > > static void announce_device(struct usb_device *udev) > { > - dev_info(&udev->dev, "New USB device found, idVendor=%04x, idProduct=%04x\n", > - le16_to_cpu(udev->descriptor.idVendor), > - le16_to_cpu(udev->descriptor.idProduct)); > + u16 bcdDevice; > + > + bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice); > + dev_info(&udev->dev, > + "New USB device found, idVendor=%04x, idProduct=%04x, bcdDevice=%2x.%02x\n", > + le16_to_cpu(udev->descriptor.idVendor), Unnecessary and incorrect whitespace changes. > + le16_to_cpu(udev->descriptor.idProduct), > + bcdDevice >> 8, bcdDevice & 0xff); > dev_info(&udev->dev, > - "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", > - udev->descriptor.iManufacturer, > - udev->descriptor.iProduct, > - udev->descriptor.iSerialNumber); > + "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", > + udev->descriptor.iManufacturer, > + udev->descriptor.iProduct, > + udev->descriptor.iSerialNumber); Same here. Alan Stern