[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230421151010.130695-1-silver_code@hust.edu.cn>
Date: Fri, 21 Apr 2023 23:10:09 +0800
From: Wang Zhang <silver_code@...t.edu.cn>
To: Felix Fietkau <nbd@....name>, John Crispin <john@...ozen.org>,
Sean Wang <sean.wang@...iatek.com>,
Mark Lee <Mark-MC.Lee@...iatek.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Cc: hust-os-kernel-patches@...glegroups.com,
Wang Zhang <silver_code@...t.edu.cn>,
Dongliang Mu <dzm91@...t.edu.cn>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: [PATCH] net: ethernet: mediatek: remove return value check of `mtk_wed_hw_add_debugfs`
Smatch complains that:
mtk_wed_hw_add_debugfs() warn: 'dir' is an error pointer or valid
Debugfs checks are generally not supposed to be checked
for errors and it is not necessary here.
fix it by just deleting the dead code.
Signed-off-by: Wang Zhang <silver_code@...t.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
---
This issue is found by static analyzer. The patched code has passed
Smatch checker, but remains untested on mediatek soc.
---
drivers/net/ethernet/mediatek/mtk_wed_debugfs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
index 56f663439721..b244c02c5b51 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
@@ -252,8 +252,6 @@ void mtk_wed_hw_add_debugfs(struct mtk_wed_hw *hw)
snprintf(hw->dirname, sizeof(hw->dirname), "wed%d", hw->index);
dir = debugfs_create_dir(hw->dirname, NULL);
- if (!dir)
- return;
hw->debugfs_dir = dir;
debugfs_create_u32("regidx", 0600, dir, &hw->debugfs_reg);
--
2.34.1
Powered by blists - more mailing lists