diff mbox series

[2/2] net/phy,neterion: Remove dead values

Message ID 20241221124445.1094460-3-ariel.otilibili-anieli@eurecom.fr (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series rt2x00,net/phy,neterion: Remove dead values | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: jdmason@kudzu.us sd@queasysnail.net andrew+netdev@lunn.ch
netdev/build_clang fail Errors and warnings before: 3 this patch: 4
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
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: 5 this patch: 5
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 39 this patch: 39
netdev/source_inline success Was 0 now: 0

Commit Message

Ariel Otilibili-Anieli Dec. 21, 2024, 12:39 p.m. UTC
Coverity-ID: 1269173, 1575053
Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@eurecom.fr>
---
 drivers/net/ethernet/neterion/s2io.c     | 2 --
 drivers/net/phy/nxp-c45-tja11xx-macsec.c | 1 -
 2 files changed, 3 deletions(-)

Comments

Andrew Lunn Dec. 21, 2024, 3:06 p.m. UTC | #1
On Sat, Dec 21, 2024 at 01:39:33PM +0100, Ariel Otilibili wrote:
> Coverity-ID: 1269173, 1575053
> Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@eurecom.fr>
> ---
>  drivers/net/ethernet/neterion/s2io.c     | 2 --
>  drivers/net/phy/nxp-c45-tja11xx-macsec.c | 1 -

Please split this into a patch per driver.

>  2 files changed, 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
> index f8016dc25e0a..4f89f9fd8043 100644
> --- a/drivers/net/ethernet/neterion/s2io.c
> +++ b/drivers/net/ethernet/neterion/s2io.c
> @@ -1969,8 +1969,6 @@ static void en_dis_err_alarms(struct s2io_nic *nic, u16 mask, int flag)
>  				   MC_ERR_REG_ECC_ALL_DBL | PLL_LOCK_N, flag,
>  				   &bar0->mc_err_mask);
>  	}
> -	nic->general_int_mask = gen_int_mask;
> -
>  	/* Remove this line when alarm interrupts are enabled */
>  	nic->general_int_mask = 0;

So this change looks reasonable, but you need to update the comment,
because it is now wrong.

>  }
> diff --git a/drivers/net/phy/nxp-c45-tja11xx-macsec.c b/drivers/net/phy/nxp-c45-tja11xx-macsec.c
> index 550ef08970f4..e15ab9ba2f50 100644
> --- a/drivers/net/phy/nxp-c45-tja11xx-macsec.c
> +++ b/drivers/net/phy/nxp-c45-tja11xx-macsec.c
> @@ -818,7 +818,6 @@ static void nxp_c45_rx_sc_update(struct phy_device *phydev,
>  	u32 cfg = 0;
>  
>  	nxp_c45_macsec_read(phydev, MACSEC_RXSC_CFG, &cfg);
> -	cfg &= ~MACSEC_RXSC_CFG_VF_MASK;
>  	cfg = phy_secy->secy->validate_frames << MACSEC_RXSC_CFG_VF_OFF;

I can see why a static analysis tool would point this out, but you
need to include some justification why your change is correct, and it
is not a bug, maybe cfg should be written back after being masked? Or
the assignment to cfg should actually be an |= not = ?

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index f8016dc25e0a..4f89f9fd8043 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -1969,8 +1969,6 @@  static void en_dis_err_alarms(struct s2io_nic *nic, u16 mask, int flag)
 				   MC_ERR_REG_ECC_ALL_DBL | PLL_LOCK_N, flag,
 				   &bar0->mc_err_mask);
 	}
-	nic->general_int_mask = gen_int_mask;
-
 	/* Remove this line when alarm interrupts are enabled */
 	nic->general_int_mask = 0;
 }
diff --git a/drivers/net/phy/nxp-c45-tja11xx-macsec.c b/drivers/net/phy/nxp-c45-tja11xx-macsec.c
index 550ef08970f4..e15ab9ba2f50 100644
--- a/drivers/net/phy/nxp-c45-tja11xx-macsec.c
+++ b/drivers/net/phy/nxp-c45-tja11xx-macsec.c
@@ -818,7 +818,6 @@  static void nxp_c45_rx_sc_update(struct phy_device *phydev,
 	u32 cfg = 0;
 
 	nxp_c45_macsec_read(phydev, MACSEC_RXSC_CFG, &cfg);
-	cfg &= ~MACSEC_RXSC_CFG_VF_MASK;
 	cfg = phy_secy->secy->validate_frames << MACSEC_RXSC_CFG_VF_OFF;
 
 	phydev_dbg(phydev, "validate frames %u\n",