[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v0 42/42] notifier: Return an error when callback is already registered
- To: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
- From: Borislav Petkov <bp@xxxxxxxxx>
- Date: Mon, 8 Nov 2021 22:18:47 +0100
- Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Ayush Sawal <ayush.sawal@xxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Rohit Maheshwari <rohitm@xxxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Vinay Kumar Yadav <vinay.yadav@xxxxxxxxxxx>, ALSA Development Mailing List <alsa-devel@xxxxxxxxxxxxxxxx>, bcm-kernel-feedback-list <bcm-kernel-feedback-list@xxxxxxxxxxxx>, Intel Graphics Development <intel-gfx@xxxxxxxxxxxxxxxxxxxxx>, intel-gvt-dev@xxxxxxxxxxxxxxxxxxxxx, alpha <linux-alpha@xxxxxxxxxxxxxxx>, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-clk <linux-clk@xxxxxxxxxxxxxxx>, Linux Crypto Mailing List <linux-crypto@xxxxxxxxxxxxxxx>, linux-edac@xxxxxxxxxxxxxxx, Linux Fbdev development list <linux-fbdev@xxxxxxxxxxxxxxx>, linux-hyperv@xxxxxxxxxxxxxxx, linux-iio@xxxxxxxxxxxxxxx, linux-leds <linux-leds@xxxxxxxxxxxxxxx>, "open list:BROADCOM NVRAM DRIVER" <linux-mips@xxxxxxxxxxxxxxx>, Parisc List <linux-parisc@xxxxxxxxxxxxxxx>, Linux PM list <linux-pm@xxxxxxxxxxxxxxx>, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, "open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM" <linux-remoteproc@xxxxxxxxxxxxxxx>, Linux-Renesas <linux-renesas-soc@xxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, scsi <linux-scsi@xxxxxxxxxxxxxxx>, Linux-sh list <linux-sh@xxxxxxxxxxxxxxx>, linux-staging@xxxxxxxxxxxxxxx, linux-tegra <linux-tegra@xxxxxxxxxxxxxxx>, linux-um <linux-um@xxxxxxxxxxxxxxxxxxx>, USB list <linux-usb@xxxxxxxxxxxxxxx>, "open list:TENSILICA XTENSA PORT (xtensa)" <linux-xtensa@xxxxxxxxxxxxxxxx>, netdev <netdev@xxxxxxxxxxxxxxx>, openipmi-developer@xxxxxxxxxxxxxxxxxxxxx, rcu@xxxxxxxxxxxxxxx, sparclinux <sparclinux@xxxxxxxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 08 Nov 2021 21:19:11 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|