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:   Thu, 30 Dec 2021 16:44:26 -0300
From:   Luiz Angelo Daros de Luca <luizluca@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     "open list:NETWORKING DRIVERS" <netdev@...r.kernel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        Alvin Šipraga <alsi@...g-olufsen.dk>,
        Arınç ÜNAL <arinc.unal@...nc9.com>
Subject: Re: [PATCH net-next v2 06/13] net: dsa: realtek: use phy_read in ds->ops

> >   static int realtek_smi_mdio_read(struct mii_bus *bus, int addr, int regnum)
> >   {
> > -     struct realtek_priv *priv = bus->priv;
> > +     struct dsa_switch *ds = ((struct realtek_priv *)bus->priv)->ds;
>
> No need to cast a void pointer, this applies throughout the entire patch
> series.
> --
Hi Florian,

Apologize for my poor C experience but I didn't understand your
suggestion. Simply removing the cast will not work because bus->priv
is void* and it needs to know it is realtek_priv in order to
indirectly reference ds. Should I keep the local priv variable instead
of removing it (this way, cast is not needed)?

Luiz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ