netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: cgel.zte@gmail.com, woojung.huh@microchip.com
Cc: UNGLinuxDriver@microchip.com, andrew@lunn.ch,
	vivien.didelot@gmail.com, olteanv@gmail.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	linux@armlinux.org.uk, netdev@vger.kernel.org,
	Xu Panda <xu.panda@zte.com.cn>, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH V2 linux-next] net: dsa: microchip: remove the unneeded result variable
Date: Mon, 12 Sep 2022 09:25:26 -0700	[thread overview]
Message-ID: <4bd8b33b-cb48-9cc7-671b-3b1431af6858@gmail.com> (raw)
In-Reply-To: <20220912080740.17542-1-xu.panda@zte.com.cn>



On 9/12/2022 1:07 AM, cgel.zte@gmail.com wrote:
> From: Xu Panda <xu.panda@zte.com.cn>
> 
> Return the value ksz_get_xmii() directly instead of storing it in
> another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Xu Panda <xu.panda@zte.com.cn>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

One comment below:

> ---
>   drivers/net/dsa/microchip/ksz9477.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
> index 42d7e4c12459..ab7245b24493 100644
> --- a/drivers/net/dsa/microchip/ksz9477.c
> +++ b/drivers/net/dsa/microchip/ksz9477.c
> @@ -884,7 +884,6 @@ void ksz9477_port_mirror_del(struct ksz_device *dev, int port,
> 
>   static phy_interface_t ksz9477_get_interface(struct ksz_device *dev, int port)
>   {
> -       phy_interface_t interface;
>          bool gbit;
> 
>          if (dev->info->internal_phy[port])
> @@ -892,9 +891,7 @@ static phy_interface_t ksz9477_get_interface(struct ksz_device *dev, int port)
> 
>          gbit = ksz_get_gbit(dev, port);


Same logic applies here, you could fold ksz_get_gbit()'s return value 
into the tail call, and once you do that, this begs the question of how 
specific the KSZ9477 implementation has really become..
> 
> -       interface = ksz_get_xmii(dev, port, gbit);
> -
> -       return interface;
> +       return ksz_get_xmii(dev, port, gbit);
>   }
> 
>   static void ksz9477_port_mmd_write(struct ksz_device *dev, int port,

-- 
Florian

      reply	other threads:[~2022-09-12 16:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  8:07 [PATCH V2 linux-next] net: dsa: microchip: remove the unneeded result variable cgel.zte
2022-09-12 16:25 ` Florian Fainelli [this message]

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=4bd8b33b-cb48-9cc7-671b-3b1431af6858@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=cgel.zte@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.com \
    --cc=xu.panda@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).