From: Conor Dooley <conor.dooley@microchip.com>
To: Andrei Coardos <aboutphysycs@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>,
<linux-riscv@lists.infradead.org>, <alex@shruggie.ro>,
<herbert@gondor.apana.org.au>, <olivia@selenic.com>,
<daire.mcnamara@microchip.com>
Subject: Re: [PATCH] char: hw_random: mpfs-rng: removed unneeded call to platform_set_drvdata()
Date: Mon, 28 Aug 2023 12:03:28 +0100 [thread overview]
Message-ID: <20230828-citable-superjet-d235f036be99@wendy> (raw)
In-Reply-To: <20230828101757.9724-1-aboutphysycs@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]
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@microchip.com>
Thanks,
Conor.
>
> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.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);
> if (ret)
> return dev_err_probe(&pdev->dev, ret, "Failed to register MPFS hwrng\n");
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-08-28 11:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 10:17 [PATCH] char: hw_random: mpfs-rng: removed unneeded call to platform_set_drvdata() Andrei Coardos
2023-08-28 11:03 ` Conor Dooley [this message]
2023-09-01 6:07 ` Alexandru Ardelean
2023-09-01 6:25 ` Conor Dooley
2023-09-15 10:38 ` Herbert Xu
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=20230828-citable-superjet-d235f036be99@wendy \
--to=conor.dooley@microchip.com \
--cc=aboutphysycs@gmail.com \
--cc=alex@shruggie.ro \
--cc=daire.mcnamara@microchip.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=olivia@selenic.com \
/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