mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: nfc: nfcsim: remove return value check of `dev_dir`
@ 2023-04-24  2:41 Jianuo Kuang
  2023-04-24  7:01 ` Krzysztof Kozlowski
  2023-04-25  1:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jianuo Kuang @ 2023-04-24  2:41 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Escande, Samuel Ortiz
  Cc: hust-os-kernel-patches, Jianuo Kuang, Dongliang Mu, netdev, linux-kernel

Smatch complains that:
nfcsim_debugfs_init_dev() warn: 'dev_dir' is an error pointer or valid

According to the documentation of the debugfs_create_dir() function,
there is no need to check the return value of this function.
Just delete the dead code.

Fixes: f9ac6273e5b8 ("NFC: nfcsim: Add support for sysfs control entry")
Signed-off-by: Jianuo Kuang <u202110722@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
 drivers/nfc/nfcsim.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c
index 85bf8d586c70..44eeb17ae48d 100644
--- a/drivers/nfc/nfcsim.c
+++ b/drivers/nfc/nfcsim.c
@@ -367,11 +367,6 @@ static void nfcsim_debugfs_init_dev(struct nfcsim *dev)
 	}
 
 	dev_dir = debugfs_create_dir(devname, nfcsim_debugfs_root);
-	if (!dev_dir) {
-		NFCSIM_ERR(dev, "Could not create debugfs entries for nfc%d\n",
-			   idx);
-		return;
-	}
 
 	debugfs_create_u8("dropframe", 0664, dev_dir, &dev->dropframe);
 }
-- 
2.25.1


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

* Re: [PATCH] drivers: nfc: nfcsim: remove return value check of `dev_dir`
  2023-04-24  2:41 [PATCH] drivers: nfc: nfcsim: remove return value check of `dev_dir` Jianuo Kuang
@ 2023-04-24  7:01 ` Krzysztof Kozlowski
  2023-04-25  1:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-24  7:01 UTC (permalink / raw)
  To: Jianuo Kuang, Thierry Escande, Samuel Ortiz
  Cc: hust-os-kernel-patches, Dongliang Mu, netdev, linux-kernel

On 24/04/2023 04:41, Jianuo Kuang wrote:
> Smatch complains that:
> nfcsim_debugfs_init_dev() warn: 'dev_dir' is an error pointer or valid
> 
> According to the documentation of the debugfs_create_dir() function,
> there is no need to check the return value of this function.
> Just delete the dead code.
> 
> Fixes: f9ac6273e5b8 ("NFC: nfcsim: Add support for sysfs control entry")
> Signed-off-by: Jianuo Kuang <u202110722@hust.edu.cn>
> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH] drivers: nfc: nfcsim: remove return value check of `dev_dir`
  2023-04-24  2:41 [PATCH] drivers: nfc: nfcsim: remove return value check of `dev_dir` Jianuo Kuang
  2023-04-24  7:01 ` Krzysztof Kozlowski
@ 2023-04-25  1:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-25  1:20 UTC (permalink / raw)
  To: Jianuo Kuang
  Cc: krzysztof.kozlowski, thierry.escande, sameo,
	hust-os-kernel-patches, dzm91, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 24 Apr 2023 10:41:40 +0800 you wrote:
> Smatch complains that:
> nfcsim_debugfs_init_dev() warn: 'dev_dir' is an error pointer or valid
> 
> According to the documentation of the debugfs_create_dir() function,
> there is no need to check the return value of this function.
> Just delete the dead code.
> 
> [...]

Here is the summary with links:
  - drivers: nfc: nfcsim: remove return value check of `dev_dir`
    https://git.kernel.org/netdev/net-next/c/e515c330d7e2

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] 3+ messages in thread

end of thread, other threads:[~2023-04-25  1:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-24  2:41 [PATCH] drivers: nfc: nfcsim: remove return value check of `dev_dir` Jianuo Kuang
2023-04-24  7:01 ` Krzysztof Kozlowski
2023-04-25  1:20 ` 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

all inboxes | Powered by JetHome®