lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Mar 2023 12:26:45 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Dan Carpenter <error27@...il.com>
Cc:     Marek Szyprowski <m.szyprowski@...sung.com>,
        Yu Zhe <yuzhe@...china.com>, linux-mmc@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        liqiong@...china.com
Subject: Re: [PATCH] mmc: core: remove unnecessary (void*) conversions

On Fri, 24 Mar 2023 at 17:39, Dan Carpenter <error27@...il.com> wrote:
>
> On Fri, Mar 24, 2023 at 02:28:57PM +0100, Marek Szyprowski wrote:
> > On 17.03.2023 07:47, Yu Zhe wrote:
> > > Pointer variables of void * type do not require type cast.
> > >
> > > Signed-off-by: Yu Zhe <yuzhe@...china.com>
> > > ---
> > >   drivers/mmc/core/debugfs.c  | 2 +-
> > >   drivers/mmc/core/host.c     | 2 +-
> > >   drivers/mmc/core/mmc_test.c | 6 +++---
> > >   3 files changed, 5 insertions(+), 5 deletions(-)
> > ...
> > > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> > > index 096093f7be00..76900f67c782 100644
> > > --- a/drivers/mmc/core/host.c
> > > +++ b/drivers/mmc/core/host.c
> > > @@ -590,7 +590,7 @@ EXPORT_SYMBOL(mmc_alloc_host);
> > >
> > >   static void devm_mmc_host_release(struct device *dev, void *res)
> > >   {
> > > -   mmc_free_host(*(struct mmc_host **)res);
> > > +   mmc_free_host(res);
> >
> > The above chunk is wrong and causes following regression on today's
> > Linux next-20230324:
>
> Ugh...
>
> Ok.  I have a script that I use to help review mechanical patches.  I
> have added an '-r cast' option to help review "remove unnecessary cast"
> patches.
>
> If you do `cat this_email.txt | rename_rev.pl -r cast` then the output
> looks like:
>
> ================
>  static void devm_mmc_host_release(struct device *dev, void *res)
>  {
> -       mmc_free_host(*res);
> +       mmc_free_host(res);
>  }
>
>  struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra)
> ================
>
> I have gone through all of Yu Zhe's patches and the rest are okay.
>
> I've attached my rename_rev.pl script.

Thanks for helping out Dan! I will use your script next time!

Kind regards
Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ