Re: [PATCH] usb: xhci: xhci_setup_port_arrays: early -ENODEV if maxports is 0.

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

 



> That is correct, the case is handled without panic, but the 0 value
> gets silently propagated until it eventually fails on line 2220:
> 	if (xhci->usb2_rhub.num_ports == 0 && xhci->usb3_rhub.num_ports == 0) {
>              xhci_warn(xhci, "No ports on the roothubs?\n");
>              return -ENODEV;
> 	}
> The benefits are only:
>   - Reporting a more precise issue
>   - Avoids iterating through the capability structures of the
>     controller
>   - failsafe if future changes

Well, simplifying things is not bad in principle, but in this case it
looks like this patch adds a branch and some 50 bytes of code/data for
the sake of optimizing something with no practical relevance (any such
hardware is useless, rejected by this driver, and violates the spec).

So, maybe just not worth the cost, no matter how small ;)

Regards,
Michal




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

  Powered by Linux