Re: [PATCH v0 42/42] notifier: Return an error when callback is already registered
From: Borislav Petkov
Date: Mon Nov 08 2021 - 16:19:39 EST
On Mon, Nov 08, 2021 at 03:59:26PM -0500, Alan Stern wrote:
> Is there really any reason for returning an error code? For example, is
> it anticipated that at some point in the future these registration calls
> might fail?
>
> Currently, the only reason for failing...
Right, I believe with not making it return void we're leaving the door
open for some, *hypothetical* future return values if we decide we need
to return them too, at some point.
Yes, I can't think of another fact to state besides that the callback
was already registered or return success but who knows what we wanna do
in the future...
And so if we change them all to void now, I think it'll be a lot more
churn to switch back to returning a non-void value and having the
callers who choose to handle that value, do so again.
So, long story short, keeping the retval - albeit not very useful right
now - is probably easier.
I hope I'm making some sense here.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette