[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230901-upper-reenter-9c2fa8bf7a47@wendy>
Date: Fri, 1 Sep 2023 07:25:47 +0100
From: Conor Dooley <conor.dooley@...rochip.com>
To: Alexandru Ardelean <alex@...uggie.ro>
CC: Andrei Coardos <aboutphysycs@...il.com>,
<linux-kernel@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<linux-riscv@...ts.infradead.org>, <herbert@...dor.apana.org.au>,
<olivia@...enic.com>, <daire.mcnamara@...rochip.com>
Subject: Re: [PATCH] char: hw_random: mpfs-rng: removed unneeded call to
platform_set_drvdata()
On Fri, Sep 01, 2023 at 09:07:56AM +0300, Alexandru Ardelean wrote:
> On Mon, Aug 28, 2023 at 2:06 PM Conor Dooley <conor.dooley@...rochip.com> wrote:
> >
> > On Mon, Aug 28, 2023 at 01:17:57PM +0300, Andrei Coardos wrote:
> > > This function call was found to be unnecessary as there is no equivalent
> > > platform_get_drvdata() call to access the private data of the driver. Also,
> > > the private data is defined in this driver, so there is no risk of it being
> > > accessed outside of this driver file.
> >
> > I think Greg previously pointed out to you that is it not sufficient to
> > check for platform_get_drvdata() alone, because the information could be
> > accessed without going through that helper. That's not the case here,
> > but it could be true elsewhere.
> >
> > Acked-by: Conor Dooley <conor.dooley@...rochip.com>
> >
> > Thanks,
> > Conor.
> >
> > >
> > > Signed-off-by: Andrei Coardos <aboutphysycs@...il.com>
> > > ---
> > > drivers/char/hw_random/mpfs-rng.c | 2 --
> > > 1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/char/hw_random/mpfs-rng.c b/drivers/char/hw_random/mpfs-rng.c
> > > index c6972734ae62..0994024daa70 100644
> > > --- a/drivers/char/hw_random/mpfs-rng.c
> > > +++ b/drivers/char/hw_random/mpfs-rng.c
> > > @@ -79,8 +79,6 @@ static int mpfs_rng_probe(struct platform_device *pdev)
> > > rng_priv->rng.read = mpfs_rng_read;
> > > rng_priv->rng.name = pdev->name;
> > >
> > > - platform_set_drvdata(pdev, rng_priv);
> > > -
> > > ret = devm_hwrng_register(&pdev->dev, &rng_priv->rng);
>
> A question would be if there is a desire to keep the prints below, or
> would this be sufficient?
>
> return devm_hwrng_register(&pdev->dev, &rng_priv->rng);
>
> If there is the desire to keep the prints, then:
Yeah, I'd like to keep a print in the failing case, thanks.
>
> Reviewed-by: Alexandru Ardelean <alex@...uggie.ro>
>
> > > if (ret)
> > > return dev_err_probe(&pdev->dev, ret, "Failed to register MPFS hwrng\n");
> > > --
> > > 2.34.1
> > >
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists