* [PATCH net-next] net/mediatek: simplify the mediatek code return expression
@ 2020-12-11 8:38 Zheng Yongjun
2020-12-15 2:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-11 8:38 UTC (permalink / raw)
To: davem, kuba
Cc: netdev, linux-kernel, sagis, jonolson, nbd, john, sean.wang,
linux-arm-kernel, Zheng Yongjun
Simplify the return expression at mtk_eth_path.c file, simplify this all.
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/net/ethernet/mediatek/mtk_eth_path.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_path.c b/drivers/net/ethernet/mediatek/mtk_eth_path.c
index 6bc9f2487384..72648535a14d 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_path.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_path.c
@@ -252,7 +252,7 @@ int mtk_gmac_sgmii_path_setup(struct mtk_eth *eth, int mac_id)
int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id)
{
- int err, path = 0;
+ int path = 0;
if (mac_id == 1)
path = MTK_ETH_PATH_GMAC2_GEPHY;
@@ -261,25 +261,17 @@ int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id)
return -EINVAL;
/* Setup proper MUXes along the path */
- err = mtk_eth_mux_setup(eth, path);
- if (err)
- return err;
-
- return 0;
+ return mtk_eth_mux_setup(eth, path);
}
int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id)
{
- int err, path;
+ int path;
path = (mac_id == 0) ? MTK_ETH_PATH_GMAC1_RGMII :
MTK_ETH_PATH_GMAC2_RGMII;
/* Setup proper MUXes along the path */
- err = mtk_eth_mux_setup(eth, path);
- if (err)
- return err;
-
- return 0;
+ return mtk_eth_mux_setup(eth, path);
}
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net/mediatek: simplify the mediatek code return expression
2020-12-11 8:38 [PATCH net-next] net/mediatek: simplify the mediatek code return expression Zheng Yongjun
@ 2020-12-15 2:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-12-15 2:00 UTC (permalink / raw)
To: Zheng Yongjun
Cc: davem, kuba, netdev, linux-kernel, sagis, jonolson, nbd, john,
sean.wang, linux-arm-kernel
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Fri, 11 Dec 2020 16:38:01 +0800 you wrote:
> Simplify the return expression at mtk_eth_path.c file, simplify this all.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_path.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
Here is the summary with links:
- [net-next] net/mediatek: simplify the mediatek code return expression
https://git.kernel.org/netdev/net-next/c/bb7eae6dd230
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-15 2:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-11 8:38 [PATCH net-next] net/mediatek: simplify the mediatek code return expression Zheng Yongjun
2020-12-15 2:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).