Skip to content

Commit

Permalink
net: ethernet: mediatek: remove return value check of `mtk_wed_hw_add…
Browse files Browse the repository at this point in the history
…_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@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wang Zhang authored and David S. Miller committed Apr 23, 2023
1 parent e0416e7 commit b148b9a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/ethernet/mediatek/mtk_wed_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b148b9a

Please sign in to comment.