linux c/s 437
This changeset added pcifront_{at,de}tach_devices() to drivers/xen/pcifront/xenbus.c, the two functions, however, return inconsistent/bogus return values, but their only caller doesn't care:
Depending on the compiler version, the case of pcifront_detach_devices() leaving 'err' uninitialized may get warned about, and pcifront_attach_devices() would return -EFAULT if called in the wrong state.
However, given the return values aren't used I'm really uncertain whether to just make the functions return 'void' or whether to fix the error values. Please advise.
Thanks, Jan
Quoted 11 lines · Jan Beulich
This changeset added pcifront_{at,de}tach_devices() to
drivers/xen/pcifront/xenbus.c, the two functions, however, return inconsistent/bogus return values, but their only caller doesn't care:
Depending on the compiler version, the case ofpcifront_detach_devices()leaving 'err' uninitialized may get warned about, andpcifront_attach_devices()would return-EFAULTif called in the wrong state.However, given the return values aren't used I'm really uncertain whether to just make the functions return 'void' or whether to fix the error values. Please advise.
It seems I didn't have much consideration on error values of
these functions when I implemented them ...
I think it would be reasonable to make pcifront_{at,de}tache_devices() return 'void' and keep the caller pcifront_backend_changed() as is.
BTW, pcifront_try_{dis,}connect() also have return values which are not handled by their only caller. I'm not certain about them, but probably we had better let these functions have 'void' return type as well.
Thanks,
Yosuke Iwamatsu