summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Brattlof <[email protected]>2025-04-09 12:26:20 -0500
committerTom Rini <[email protected]>2025-05-06 15:43:19 -0600
commit13d1bd5bbbfaf725a4c159851203d658c1de83ba (patch)
treef0150f126cc5103c5bb484fba2192b392d608cbb
parent46b3580c59466563bd26aa6aec1f15a8adf5dd5f (diff)
mips: octeon: remove unused middle expression
!A || (A && B) is equivalent to !A || B Drop the unused middle expression to simplify the statement. Signed-off-by: Bryan Brattlof <[email protected]> Reviewed-by: Daniel Schwierzeck <[email protected]>
-rw-r--r--arch/mips/mach-octeon/cvmx-helper-board.c3
-rw-r--r--arch/mips/mach-octeon/cvmx-helper.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/arch/mips/mach-octeon/cvmx-helper-board.c b/arch/mips/mach-octeon/cvmx-helper-board.c
index 6dcc4e557e1..8d9388983b7 100644
--- a/arch/mips/mach-octeon/cvmx-helper-board.c
+++ b/arch/mips/mach-octeon/cvmx-helper-board.c
@@ -386,8 +386,7 @@ cvmx_helper_link_info_t __cvmx_helper_board_link_get_from_dt(int ipd_port)
/* If the link is down or the link is up but we still register
* the module as being absent, re-check mod_abs.
*/
- if (!result.s.link_up ||
- (result.s.link_up && sfp_info->last_mod_abs))
+ if (!result.s.link_up || sfp_info->last_mod_abs)
__cvmx_helper_update_sfp(ipd_port, sfp_info, result);
sfp_info = sfp_info->next_iface_sfp;
}
diff --git a/arch/mips/mach-octeon/cvmx-helper.c b/arch/mips/mach-octeon/cvmx-helper.c
index ccec57edf84..7dcaa1ac8d9 100644
--- a/arch/mips/mach-octeon/cvmx-helper.c
+++ b/arch/mips/mach-octeon/cvmx-helper.c
@@ -1729,7 +1729,7 @@ cvmx_helper_link_info_t cvmx_helper_link_get(int xipd_port)
sfp_info = cvmx_helper_cfg_get_sfp_info(xiface, index);
while (sfp_info) {
- if ((!result.s.link_up || (result.s.link_up && sfp_info->last_mod_abs)))
+ if (!result.s.link_up || sfp_info->last_mod_abs)
cvmx_sfp_check_mod_abs(sfp_info, sfp_info->mod_abs_data);
sfp_info = sfp_info->next_iface_sfp;
}