From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
<kuba@kernel.org>, <linux-kernel@vger.kernel.org>,
<bryan.whitehead@microchip.com>, <pabeni@redhat.com>,
<edumazet@google.com>, <olteanv@gmail.com>,
<linux@armlinux.org.uk>, <UNGLinuxDriver@microchip.com>,
<andrew@lunn.ch>, <Ian.Saturley@microchip.com>
Subject: Re: [PATCH net-next V6 1/2] net: lan743x: Remove unused argument in lan743x_common_regs( )
Date: Wed, 2 Nov 2022 18:12:07 +0100 [thread overview]
Message-ID: <20221102171207.omyob44532fu4bvm@soft-dev3-1> (raw)
In-Reply-To: <20221102104834.5555-2-Raju.Lakkaraju@microchip.com>
The 11/02/2022 16:18, Raju Lakkaraju wrote:
Hi Raju,
> Remove the unused argument (i.e. struct ethtool_regs *regs) in
> lan743x_common_regs( ) function arguments.
>
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
> ---
> drivers/net/ethernet/microchip/lan743x_ethtool.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/microchip/lan743x_ethtool.c b/drivers/net/ethernet/microchip/lan743x_ethtool.c
> index 88f9484cc2a7..fd59708ac4b5 100644
> --- a/drivers/net/ethernet/microchip/lan743x_ethtool.c
> +++ b/drivers/net/ethernet/microchip/lan743x_ethtool.c
> @@ -1190,15 +1190,11 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev,
> }
> #endif /* CONFIG_PM */
>
> -static void lan743x_common_regs(struct net_device *dev,
> - struct ethtool_regs *regs, void *p)
> -
> +static void lan743x_common_regs(struct net_device *dev, void *p)
> {
> struct lan743x_adapter *adapter = netdev_priv(dev);
> u32 *rb = p;
>
> - memset(p, 0, (MAX_LAN743X_ETH_REGS * sizeof(u32)));
> -
It seems that you do more here than what you said.
You remove the unused argument but you also remove the memset. And it
is a problem because p is not initialized anymore.
> rb[ETH_PRIV_FLAGS] = adapter->flags;
> rb[ETH_ID_REV] = lan743x_csr_read(adapter, ID_REV);
> rb[ETH_FPGA_REV] = lan743x_csr_read(adapter, FPGA_REV);
> @@ -1230,7 +1226,7 @@ static void lan743x_get_regs(struct net_device *dev,
> {
> regs->version = LAN743X_ETH_REG_VERSION;
>
> - lan743x_common_regs(dev, regs, p);
> + lan743x_common_regs(dev, p);
> }
>
> static void lan743x_get_pauseparam(struct net_device *dev,
> --
> 2.25.1
>
--
/Horatiu
next prev parent reply other threads:[~2022-11-02 17:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 10:48 [PATCH net-next V6 0/2]net: lan743x: PCI11010 / PCI11414 devices Enhancements Raju Lakkaraju
2022-11-02 10:48 ` [PATCH net-next V6 1/2] net: lan743x: Remove unused argument in lan743x_common_regs( ) Raju Lakkaraju
2022-11-02 17:12 ` Horatiu Vultur [this message]
2022-11-02 10:48 ` [PATCH net-next V6 2/2] net: lan743x: Add support to SGMII register dump for PCI11010/PCI11414 chips Raju Lakkaraju
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=20221102171207.omyob44532fu4bvm@soft-dev3-1 \
--to=horatiu.vultur@microchip.com \
--cc=Ian.Saturley@microchip.com \
--cc=Raju.Lakkaraju@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=bryan.whitehead@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--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 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).