Thread (9 messages) 9 messages, 3 authors, 2021-11-08

Re: [PATCH v0 42/42] notifier: Return an error when callback is already registered

From: Borislav Petkov <bp@alien8.de>
Date: 2021-11-08 15:59:15
Also in: alsa-devel, intel-gfx, linux-alpha, linux-arm-kernel, linux-clk, linux-crypto, linux-edac, linux-fbdev, linux-hyperv, linux-iio, linux-leds, linux-mips, linux-pm, linux-remoteproc, linux-renesas-soc, linux-s390, linux-scsi, linux-sh, linux-staging, linux-tegra, linux-um, linux-usb, lkml, netdev, rcu, sparclinux, xen-devel

On Mon, Nov 08, 2021 at 04:25:47PM +0100, Geert Uytterhoeven wrote:
I'm not against returning proper errors codes.  I'm against forcing
callers to check things that cannot fail and to add individual error
printing to each and every caller.
If you're against checking things at the callers, then the registration
function should be void. IOW, those APIs are not optimally designed atm.
Note that in other areas, we are moving in the other direction,
to a centralized printing of error messages, cfr. e.g. commit
7723f4c5ecdb8d83 ("driver core: platform: Add an error message to
platform_get_irq*()").
Yes, thus my other idea to add a lower level __notifier_chain_register()
to do the checking.

I'll see if I can convert those notifier registration functions to
return void, in the process. But let's see what the others think first.

Thanks for taking the time.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help