lkml.org 
[lkml]   [2019]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] stmmac: platform: Remove unnecessary conditions
On Wed, 11 Dec 2019 10:31:24 +0000, Xu Wang wrote:
> Remove conditions where if and else branch are identical.
> This issue is detected by coccinelle.
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index bedaff0..1d26691 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -229,8 +229,6 @@ static int stmmac_mtl_setup(struct platform_device *pdev,
> plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WFQ;
> else if (of_property_read_bool(tx_node, "snps,tx-sched-dwrr"))
> plat->tx_sched_algorithm = MTL_TX_ALGORITHM_DWRR;
> - else if (of_property_read_bool(tx_node, "snps,tx-sched-sp"))
> - plat->tx_sched_algorithm = MTL_TX_ALGORITHM_SP;
> else
> plat->tx_sched_algorithm = MTL_TX_ALGORITHM_SP;
>

Thanks for the patch but in this case it looks like this code is
intentionally written this way to enumerate all options. Maintainers -
please speak up if you prefer to have the patch applied, otherwise
I'm dropping it.

\
 
 \ /
  Last update: 2019-12-14 21:11    [W:0.025 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site