mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ilija Hadzic <ihadzic@research.bell-labs.com>
To: Valentina Manea <valentina.manea.m@gmail.com>
Cc: gregkh@linuxfoundation.org, ly80toro@cip.cs.fau.de,
	standby24x7@gmail.com, alan@linux.intel.com,
	anthony.foiani@gmail.com, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, devel@driverdev.osuosl.org,
	andy.grover@gmail.com
Subject: Re: [PATCH] staging: usbip: add support for viewing imported devices
Date: Mon, 23 Dec 2013 13:43:52 -0600 (CST)	[thread overview]
Message-ID: <Pine.GSO.4.64.1312231312580.15803@umail> (raw)
In-Reply-To: <1387821655-24720-1-git-send-email-valentina.manea.m@gmail.com>



On Mon, 23 Dec 2013, Valentina Manea wrote:

> As of Matt Mooney's major refactoring in 2011, usbip port
> option was left out. Add support for this option in
> a manner similar to the old implementation.
>

Yeah, I guess most people (incluing myself) have been just happy with
just cat-ing the files in /var/run/vhci_hcd. Anyway, I guess it doesn't 
hurt to have it in the tool.

> Sample output:
>
> Imported USB devices
> ====================
> Port 00: <Port in Use> at Full Speed(12Mbps)
>       unknown vendor : unknown product (1687:6211)
>       2-1 -> usbip://192.168.122.152:3240/1-1 (remote devid 00010002 (bus/dev 001/002))
>

I don't find devid very useful when you are already printing bus and 
device number; devid is just a different format for the same thing. Just 
bus number and device number should suffice.

>
> [SNIP]
>
>
> +int usbip_vhci_imported_device_dump(struct usbip_imported_device *idev)
> +{
>
> [SNIP]
>
> +
> +	ret = read_record(idev->port, host, serv, remote_busid);
> +	if (ret) {
> +		err("read_record");
> +		return -1;
> +	}
> +

If the caller is looping over the ports and dumping one port fails because 
some bozo has rm-ed the record file, is it the right thing to bail out of 
completely? You may want to consider continuing with the loop and still 
show what can be shown (and mark unshowable ports as such).

In that sense, you probably don't want to return an error here.

>
> +	printf("Port %02d: <%s> at %s\n", idev->port,
> +	       usbip_status_string(idev->status),
> +	       usbip_speed_string(idev->udev.speed));
>
> [SNIP]
>
> +int usbip_port_show(int argc, char *argv[])
> +{
> +	(void) argc;
> +	(void) argv;
> +

This is an ugly way to suppress the warning. Consider using 
__attribute__((unused)) instead.


-- Ilija


  reply	other threads:[~2013-12-23 20:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-23 18:00 Valentina Manea
2013-12-23 19:43 ` Ilija Hadzic [this message]
2014-01-02 10:10   ` Dan Carpenter
2013-12-23 23:24 ` [PATCH v2] " Valentina Manea
2013-12-24  3:23   ` Ilija Hadzic
2013-12-24  8:27 ` [PATCH v3] staging: usbip: userspace: " Valentina Manea
2013-12-24 13:28   ` Ilija Hadzic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.64.1312231312580.15803@umail \
    --to=ihadzic@research.bell-labs.com \
    --cc=alan@linux.intel.com \
    --cc=andy.grover@gmail.com \
    --cc=anthony.foiani@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ly80toro@cip.cs.fau.de \
    --cc=standby24x7@gmail.com \
    --cc=valentina.manea.m@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®