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

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

From: Borislav Petkov <bp@alien8.de>
Date: 2021-11-08 14:24:50
Also in: alsa-devel, intel-gfx, linux-alpha, linux-arm-kernel, linux-clk, linux-crypto, linux-edac, 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, linuxppc-dev, lkml, netdev, rcu, sparclinux, xen-devel

On Mon, Nov 08, 2021 at 09:17:03AM -0500, Alan Stern wrote:
What reason is there for moving the check into the callers?  It seems 
like pointless churn.  Why not add the error return code, change the 
WARN to pr_warn, and leave the callers as they are?  Wouldn't that end 
up having exactly the same effect?

For that matter, what sort of remedial action can a caller take if the 
return code is -EEXIST?  Is there any point in forcing callers to check 
the return code if they can't do anything about it?
See my reply to Geert from just now:

https://lore.kernel.org/r/YYkyUEqcsOwQMb1S@zn.tnic (local)

I guess I can add another indirection to notifier_chain_register() and
avoid touching all the call sites.

-- 
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