netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] wifi: mt7601u: delete dead code checking debugfs returns
@ 2023-04-21  9:22 Wang Jikai
  2023-04-21 14:28 ` Jakub Kicinski
  2023-05-05 12:03 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Jikai @ 2023-04-21  9:22 UTC (permalink / raw)
  To: Jakub Kicinski, Kalle Valo, David S. Miller, Eric Dumazet,
	Paolo Abeni, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: hust-os-kernel-patches, Wang Jikai, linux-wireless, netdev,
	linux-kernel, linux-arm-kernel, linux-mediatek

Smatch reports that:
drivers/net/wireless/mediatek/mt7601u/debugfs.c:130
mt7601u_init_debugfs() warn: 'dir' is an error pointer or valid".

Debugfs code is not supposed to need error checking so instead of
changing this to if (IS_ERR()) the correct thing is to just delete
the dead code.

Signed-off-by: Wang Jikai <wangjikai@hust.edu.cn>
---
v1 -> v2: not add redundant removal of debugfs dir. remove fixes
tag.

The issue is found by static analysis and remains untested.
---
 drivers/net/wireless/mediatek/mt7601u/debugfs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt7601u/debugfs.c b/drivers/net/wireless/mediatek/mt7601u/debugfs.c
index 230b0e1061a7..dbddf256921b 100644
--- a/drivers/net/wireless/mediatek/mt7601u/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt7601u/debugfs.c
@@ -127,8 +127,6 @@ void mt7601u_init_debugfs(struct mt7601u_dev *dev)
 	struct dentry *dir;
 
 	dir = debugfs_create_dir("mt7601u", dev->hw->wiphy->debugfsdir);
-	if (!dir)
-		return;
 
 	debugfs_create_u8("temperature", 0400, dir, &dev->raw_temp);
 	debugfs_create_u32("temp_mode", 0400, dir, &dev->temp_mode);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] wifi: mt7601u: delete dead code checking debugfs returns
  2023-04-21  9:22 [PATCH v2] wifi: mt7601u: delete dead code checking debugfs returns Wang Jikai
@ 2023-04-21 14:28 ` Jakub Kicinski
  2023-05-05 12:03 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-04-21 14:28 UTC (permalink / raw)
  To: Wang Jikai
  Cc: Kalle Valo, David S. Miller, Eric Dumazet, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno,
	hust-os-kernel-patches, linux-wireless, netdev, linux-kernel,
	linux-arm-kernel, linux-mediatek

On Fri, 21 Apr 2023 09:22:00 +0000 Wang Jikai wrote:
> Smatch reports that:
> drivers/net/wireless/mediatek/mt7601u/debugfs.c:130
> mt7601u_init_debugfs() warn: 'dir' is an error pointer or valid".
> 
> Debugfs code is not supposed to need error checking so instead of
> changing this to if (IS_ERR()) the correct thing is to just delete
> the dead code.
> 
> Signed-off-by: Wang Jikai <wangjikai@hust.edu.cn>

Acked-by: Jakub Kicinski <kuba@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] wifi: mt7601u: delete dead code checking debugfs returns
  2023-04-21  9:22 [PATCH v2] wifi: mt7601u: delete dead code checking debugfs returns Wang Jikai
  2023-04-21 14:28 ` Jakub Kicinski
@ 2023-05-05 12:03 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2023-05-05 12:03 UTC (permalink / raw)
  To: Wang Jikai
  Cc: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno,
	hust-os-kernel-patches, Wang Jikai, linux-wireless, netdev,
	linux-kernel, linux-arm-kernel, linux-mediatek

Wang Jikai <wangjikai@hust.edu.cn> wrote:

> Smatch reports that:
> drivers/net/wireless/mediatek/mt7601u/debugfs.c:130
> mt7601u_init_debugfs() warn: 'dir' is an error pointer or valid".
> 
> Debugfs code is not supposed to need error checking so instead of
> changing this to if (IS_ERR()) the correct thing is to just delete
> the dead code.
> 
> Signed-off-by: Wang Jikai <wangjikai@hust.edu.cn>
> Acked-by: Jakub Kicinski <kuba@kernel.org>

Patch applied to wireless-next.git, thanks.

f3dc7bb037d8 wifi: mt7601u: delete dead code checking debugfs returns

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20230421092200.24456-1-wangjikai@hust.edu.cn/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-05 12:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-21  9:22 [PATCH v2] wifi: mt7601u: delete dead code checking debugfs returns Wang Jikai
2023-04-21 14:28 ` Jakub Kicinski
2023-05-05 12:03 ` Kalle Valo

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).