Re: [PATCH] firmware:Remove unnecessary (void*) conversions

From: Geert Uytterhoeven
Date: Fri Apr 21 2023 - 03:23:05 EST


Hi Yunchan,

On Thu, Apr 20, 2023 at 9:41 AM yunchuan <yunchuan@xxxxxxxxxxxx> wrote:
> Pointer variables of void * type do not require type cast.
>
> Signed-off-by: yunchuan <yunchuan@xxxxxxxxxxxx>

> --- a/drivers/firmware/turris-mox-rwtm.c
> +++ b/drivers/firmware/turris-mox-rwtm.c
> @@ -283,7 +283,7 @@ static int check_get_random_support(struct mox_rwtm *rwtm)
>
> static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
> {
> - struct mox_rwtm *rwtm = (struct mox_rwtm *) rng->priv;

hwrng.priv is unsigned long, so the cast is needed.
Please try to (at least) test-compile your changes.

NAKed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

> + struct mox_rwtm *rwtm = rng->priv;
> struct armada_37xx_rwtm_tx_msg msg;
> int ret;


Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds