All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Thangaraj.S@microchip.com>
To: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<hkallweit1@gmail.com>, <Rengarajan.S@microchip.com>,
	<kuba@kernel.org>, <pabeni@redhat.com>, <edumazet@google.com>,
	<UNGLinuxDriver@microchip.com>
Cc: <linux-usb@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH v2 net-next] net: usb: lan78xx: make struct fphy_status static const
Date: Wed, 11 Jun 2025 07:02:52 +0000	[thread overview]
Message-ID: <58e97a033835bc9347e24ff50aea26275054e9b2.camel@microchip.com> (raw)
In-Reply-To: <0890f92e-a03d-4aa7-8bc8-94123d253f22@gmail.com>

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@gmail.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

  reply	other threads:[~2025-06-11  7:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 20:58 [PATCH v2 net-next] net: usb: lan78xx: make struct fphy_status static const Heiner Kallweit
2025-06-11  7:02 ` Thangaraj.S [this message]
2025-06-11 19:16   ` Heiner Kallweit
2025-06-11 21:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58e97a033835bc9347e24ff50aea26275054e9b2.camel@microchip.com \
    --to=thangaraj.s@microchip.com \
    --cc=Rengarajan.S@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.