lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Dec 2013 13:43:52 -0600 (CST)
From:	Ilija Hadzic <ihadzic@...earch.bell-labs.com>
To:	Valentina Manea <valentina.manea.m@...il.com>
cc:	gregkh@...uxfoundation.org, ly80toro@....cs.fau.de,
	standby24x7@...il.com, alan@...ux.intel.com,
	anthony.foiani@...il.com, linux-kernel@...r.kernel.org,
	linux-usb@...r.kernel.org, devel@...verdev.osuosl.org,
	andy.grover@...il.com
Subject: Re: [PATCH] staging: usbip: add support for viewing imported devices



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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ