On Mon Mar 25 09:11:09 2024 +0000, Rémi Bernon wrote:
You're checking for the same condition in the next commit, so this one then becomes unnecessary. I'd also prefer to only check for this in the callers. As a side note, FIXME is supposed to be used for things that are not implemented yet, not for bugs. It's better to use WARN or ERR (the latter in the case of a programming or irrecoverable error, the former in the case of an error that can genuinely happen under some circumstances).
I thought that it would be good idea to add this log statement regardless of the current usage of `find_device_from_devnode()`, to make it "future-proof": whenever this function gets called with NULL argument, it's always an error. Had it been there, I would have found the issue a bit faster. Now the log contained only `warn:hid:bus_main_thread L"UDEV" bus wait returned status 0xc0000005`. The code `0xc0000005` of course hinted that an invalid pointer is being used, but it was not immediately clear where.
And, yes, ERR would be then better than FIXME. I think I just mimiced some existing error condition, the FIXME usage does not seem to be entirely consistent.