netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Dominik Brodowski <linux@dominikbrodowski.net>
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 12:42:56 +0100	[thread overview]
Message-ID: <CAHmME9rSz-GqvQf9S9fPLUvSwP0iky90bipGj-o94tkAU1QP1g@mail.gmail.com> (raw)
In-Reply-To: <Yh8Bsk9RSm22Yr8d@owl.dominikbrodowski.net>

Hi Dominik,

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.

Jason

  reply	other threads:[~2022-03-02 11:43 UTC|newest]

Thread overview: 13+ 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 [this message]
2022-03-02 14:53       ` Dominik Brodowski
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

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=CAHmME9rSz-GqvQf9S9fPLUvSwP0iky90bipGj-o94tkAU1QP1g@mail.gmail.com \
    --to=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=linux@dominikbrodowski.net \
    --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).