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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 24 Mar 2023 19:39:40 +0300
From:   Dan Carpenter <error27@...il.com>
To:     Marek Szyprowski <m.szyprowski@...sung.com>
Cc:     Yu Zhe <yuzhe@...china.com>, ulf.hansson@...aro.org,
        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, 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.

regards,
dan carpenter


View attachment "rename_rev.pl" of type "text/x-perl" (11309 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ