From: Dominik Brodowski <linux@dominikbrodowski.net>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
Netdev <netdev@vger.kernel.org>, Alexander Graf <graf@amazon.com>,
Jann Horn <jannh@google.com>,
Greg KH <gregkh@linuxfoundation.org>,
Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH 1/3] random: replace custom notifier chain with standard one
Date: Wed, 2 Mar 2022 15:53:18 +0100 [thread overview]
Message-ID: <Yh+E3pnWM5lX+X0l@owl.dominikbrodowski.net> (raw)
In-Reply-To: <CAHmME9rSz-GqvQf9S9fPLUvSwP0iky90bipGj-o94tkAU1QP1g@mail.gmail.com>
Hi Jason,
Am Wed, Mar 02, 2022 at 12:42:56PM +0100 schrieb Jason A. Donenfeld:
> On Wed, Mar 2, 2022 at 6:35 AM Dominik Brodowski
> <linux@dominikbrodowski.net> wrote:
> >
> > Am Wed, Mar 02, 2022 at 12:10:36AM +0100 schrieb Jason A. Donenfeld:
> > > /*
> > > * Delete a previously registered readiness callback function.
> > > */
> > > -void del_random_ready_callback(struct random_ready_callback *rdy)
> > > +int unregister_random_ready_notifier(struct notifier_block *nb)
> > > {
> > > unsigned long flags;
> > > - struct module *owner = NULL;
> > > -
> > > - spin_lock_irqsave(&random_ready_list_lock, flags);
> > > - if (!list_empty(&rdy->list)) {
> > > - list_del_init(&rdy->list);
> > > - owner = rdy->owner;
> > > - }
> > > - spin_unlock_irqrestore(&random_ready_list_lock, flags);
> > > + int ret;
> > >
> > > - module_put(owner);
> > > + spin_lock_irqsave(&random_ready_chain_lock, flags);
> > > + ret = raw_notifier_chain_unregister(&random_ready_chain, nb);
> > > + spin_unlock_irqrestore(&random_ready_chain_lock, flags);
> > > + return ret;
> > > }
> > > -EXPORT_SYMBOL(del_random_ready_callback);
> >
> > That doesn't seem to be used anywhere, so I'd suggest removing this function
> > altogether.
>
> I thought about this, but it feels weird to have a registration
> function without an unregistration function... No other notifier is
> unbalanced like that.
... but having unused code compiled in (unless LTO is enabled, of course)
seems worse. Maybe comment it out, #ifdef COMPILE_TEST or something like
that?
Thanks,
Dominik
next prev parent reply other threads:[~2022-03-02 14:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 23:10 [PATCH 0/3] random: wire up in-kernel virtual machine fork notifications Jason A. Donenfeld
2022-03-01 23:10 ` [PATCH 1/3] random: replace custom notifier chain with standard one Jason A. Donenfeld
2022-03-02 5:33 ` Dominik Brodowski
2022-03-02 11:42 ` Jason A. Donenfeld
2022-03-02 14:53 ` Dominik Brodowski [this message]
2022-03-01 23:10 ` [PATCH 2/3] random: provide notifier for VM fork Jason A. Donenfeld
2022-03-02 8:53 ` Greg KH
2022-03-02 11:41 ` Jason A. Donenfeld
2022-03-01 23:10 ` [PATCH 3/3] wireguard: device: clear keys on " Jason A. Donenfeld
2022-03-01 23:25 ` Jakub Kicinski
2022-03-02 8:36 ` Michael S. Tsirkin
2022-03-02 11:44 ` Jason A. Donenfeld
2022-03-02 13:06 ` Michael S. Tsirkin
2022-03-13 1:07 ` [PATCH v2] " Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yh+E3pnWM5lX+X0l@owl.dominikbrodowski.net \
--to=linux@dominikbrodowski.net \
--cc=Jason@zx2c4.com \
--cc=graf@amazon.com \
--cc=gregkh@linuxfoundation.org \
--cc=jannh@google.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).