From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 8 Nov 2021 16:58:57 +0100 From: Borislav Petkov Subject: Re: [PATCH v0 42/42] notifier: Return an error when callback is already registered Message-ID: References: <20211108101157.15189-1-bp@alien8.de> <20211108101157.15189-43-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: To: Geert Uytterhoeven Cc: LKML , Thomas Gleixner , Arnd Bergmann , Ayush Sawal , Greg Kroah-Hartman , Rohit Maheshwari , Steven Rostedt , Vinay Kumar Yadav , ALSA Development Mailing List , bcm-kernel-feedback-list , Intel Graphics Development , intel-gvt-dev@lists.freedesktop.org, alpha , Linux ARM , linux-clk , Linux Crypto Mailing List , linux-edac@vger.kernel.org, Linux Fbdev development list , linux-hyperv@vger.kernel.org, linux-iio@vger.kernel.org, linux-leds , "open list:BROADCOM NVRAM DRIVER" , Parisc List , Linux PM list , linuxppc-dev , "open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM" , Linux-Renesas , linux-s390 , scsi , Linux-sh list , linux-staging@lists.linux.dev, linux-tegra , linux-um , USB list , "open list:TENSILICA XTENSA PORT (xtensa)" , netdev , openipmi-developer@lists.sourceforge.net, rcu@vger.kernel.org, sparclinux , the arch/x86 maintainers , xen-devel@lists.xenproject.org List-ID: 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