On Wed, Oct 24, 2012 at 09:24:04PM +0800, Lan Tianyu wrote:
> δΊ 2012/10/24 18:55, Sergei Shtylyov ει:
> >> + /* Create link files between child device and usb port device. */
> >> + if (udev->parent) {
> >> + int no_warn;
> >
> > I think 'ret' or 'result' is a better name...
> >
> >> + struct usb_port *port_dev =
> >> + hdev_to_hub(udev->parent)->ports[udev->portnum - 1];
> >> +
> >> + no_warn = sysfs_create_link(&udev->dev.kobj,
> >> + &port_dev->dev.kobj, "port");
> >> + no_warn = sysfs_create_link(&port_dev->dev.kobj,
> >> + &udev->dev.kobj, "child");
> >
> > I guess you are not supposed to ignore the result if the function
> > requires
> > it not to be ignored.
> >
> Hi Sergei:
> Great thanks for your review. From my opinion, failure to create link
> will
> not affect usb device function and so the return value can be ignored,
> Perharps
> producing
> some warning will be better. Do you have some suggestion? :)
Properly handle the error, don't ignore it.
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html