diff mbox series

[net-next,V6,1/2] net: lan743x: Remove unused argument in lan743x_common_regs( )

Message ID 20221102104834.5555-2-Raju.Lakkaraju@microchip.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: lan743x: PCI11010 / PCI11414 devices Enhancements | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Raju Lakkaraju - I30499 Nov. 2, 2022, 10:48 a.m. UTC
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(-)

Comments

Horatiu Vultur Nov. 2, 2022, 5:12 p.m. UTC | #1
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
>
diff mbox series

Patch

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)));
-
 	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,