[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4ae309b5-e840-4db2-bc33-2cb53209d32c@intel.com>
Date: Wed, 27 Aug 2025 15:42:28 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Liao Yuanhong <liaoyuanhong@...o.com>
CC: Tony Nguyen <anthony.l.nguyen@...el.com>, Andrew Lunn
<andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, "Eric
Dumazet" <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, "moderated list:INTEL ETHERNET DRIVERS"
<intel-wired-lan@...ts.osuosl.org>, "open list:NETWORKING DRIVERS"
<netdev@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next] intel: Remove redundant ternary operators
On 8/27/25 14:12, Liao Yuanhong wrote:
> For ternary operators in the form of "a ? true : false", if 'a' itself
> returns a boolean result, the ternary operator can be omitted. Remove
> redundant ternary operators to clean up the code.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
Netdev discourages patches which perform simple clean-ups, which are not
in the context of other work
https://docs.kernel.org/process/maintainer-netdev.html#clean-up-patches
> ---
> drivers/net/ethernet/intel/igb/e1000_phy.c | 2 +-
> drivers/net/ethernet/intel/igc/igc_phy.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c
> index cd65008c7ef5..c21cd6311f45 100644
> --- a/drivers/net/ethernet/intel/igb/e1000_phy.c
> +++ b/drivers/net/ethernet/intel/igb/e1000_phy.c
> @@ -1652,7 +1652,7 @@ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
> udelay(usec_interval);
> }
>
> - *success = (i < iterations) ? true : false;
> + *success = i < iterations;
>
> return ret_val;
> }
> diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
> index 6c4d204aecfa..828884d76f04 100644
> --- a/drivers/net/ethernet/intel/igc/igc_phy.c
> +++ b/drivers/net/ethernet/intel/igc/igc_phy.c
> @@ -94,7 +94,7 @@ s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations,
> udelay(usec_interval);
> }
>
> - *success = (i < iterations) ? true : false;
> + *success = i < iterations;
>
> return ret_val;
> }
Powered by blists - more mailing lists