[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211202143149.jeqf4bhhsr534pwo@linutronix.de>
Date: Thu, 2 Dec 2021 15:31:49 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Borislav Petkov <bp@...en8.de>
Cc: X86 ML <x86@...nel.org>,
Valentin Schneider <valentin.schneider@....com>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Alan Stern <stern@...land.harvard.edu>,
Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] notifier: Return an error when a callback has already
been registered
On 2021-12-02 15:23:36 [+0100], Borislav Petkov wrote:
> On Thu, Dec 02, 2021 at 03:16:30PM +0100, Sebastian Andrzej Siewior wrote:
> > > while ((*nl) != NULL) {
> > > - if (unlikely((*nl) == n)) {
> > > - WARN(1, "double register detected");
> > > - return 0;
> >
> > This could be s/0/-EEXIST/ or do I miss something?
>
> It is...
…
> > > - }
> > > + if (unlikely((*nl) == n))
> > > + return -EEXIST;
> ^^^^^^^^^^^^^^^
>
> ... right here.
I meant without the extra function. I'm fine either way, just curious :)
Sebastian
Powered by blists - more mailing lists