Nico Huber has posted comments on this change. ( https://review.coreboot.org/27444 )
Change subject: usbdev: Refactor device discovery code ......................................................................
Patch Set 4: Code-Review+2
(2 comments)
I would drop the added `handle` check, but that's probably a matter of taste :)
https://review.coreboot.org/#/c/27444/2/usbdev.c File usbdev.c:
https://review.coreboot.org/#/c/27444/2/usbdev.c@84 PS2, Line 84:
To follow up, the compiler won't let us do this. […]
I guess we could cast `filter_by_serial` in the call to get_by_vid_pid_filter(). But it won't gain us much...
https://review.coreboot.org/#/c/27444/2/usbdev.c@105 PS2, Line 105:
Fair point. […]
Actually the check makes it more confusing to me. If *nump == 0, we want to stop filtering no matter if this is the first or second call. One could say that we won't decrement *nump accidentally on a call with handle != NULL... but if you think it that far, you should already realize that the check is superfluous.