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]
Message-ID: <58e97a033835bc9347e24ff50aea26275054e9b2.camel@microchip.com>
Date: Wed, 11 Jun 2025 07:02:52 +0000
From: <Thangaraj.S@...rochip.com>
To: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <hkallweit1@...il.com>,
	<Rengarajan.S@...rochip.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
	<edumazet@...gle.com>, <UNGLinuxDriver@...rochip.com>
CC: <linux-usb@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH v2 net-next] net: usb: lan78xx: make struct fphy_status
 static const

Hi Heiner,
Thanks for the patch
On Tue, 2025-06-10 at 22:58 +0200, Heiner Kallweit wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> Constify variable fphy_status and make it static.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
> ---
> v2:
> - extend commit message
> ---
>  drivers/net/usb/lan78xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index 759dab980..17c23eada 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -2630,7 +2630,7 @@ static int lan78xx_configure_flowcontrol(struct
> lan78xx_net *dev,
>   */
>  static struct phy_device *lan78xx_register_fixed_phy(struct
> lan78xx_net *dev)
>  {
> -       struct fixed_phy_status fphy_status = {
> +       static const struct fixed_phy_status fphy_status = {
>                 .link = 1,
>                 .speed = SPEED_1000,
>                 .duplex = DUPLEX_FULL,
> --
> 2.49.0
> 

This patch changes fphy_status to static const, but as far as I can tell,the function is only called once during probe, and the struct is
initialized and used immediately. Since it's not reused and doesn't
need to persist beyond the function call, I don't see a clear reason
for making it static const. Is there a specific motivation behind this
change?

Thanks,
Thangaraj Samynathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ