netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.14 4/6] nfcsim.c: Fix error checking for debugfs_create_dir
       [not found] <20230615114016.649846-1-sashal@kernel.org>
@ 2023-06-15 11:40 ` Sasha Levin
  2023-06-16 19:35   ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2023-06-15 11:40 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Osama Muhammad, Simon Horman, David S . Miller, Sasha Levin,
	krzysztof.kozlowski, netdev

From: Osama Muhammad <osmtendev@gmail.com>

[ Upstream commit 9b9e46aa07273ceb96866b2e812b46f1ee0b8d2f ]

This patch fixes the error checking in nfcsim.c.
The DebugFS kernel API is developed in
a way that the caller can safely ignore the errors that
occur during the creation of DebugFS nodes.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nfc/nfcsim.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c
index 533e3aa6275cd..cf07b366500e9 100644
--- a/drivers/nfc/nfcsim.c
+++ b/drivers/nfc/nfcsim.c
@@ -345,10 +345,6 @@ static struct dentry *nfcsim_debugfs_root;
 static void nfcsim_debugfs_init(void)
 {
 	nfcsim_debugfs_root = debugfs_create_dir("nfcsim", NULL);
-
-	if (!nfcsim_debugfs_root)
-		pr_err("Could not create debugfs entry\n");
-
 }
 
 static void nfcsim_debugfs_remove(void)
-- 
2.39.2


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

* Re: [PATCH AUTOSEL 4.14 4/6] nfcsim.c: Fix error checking for debugfs_create_dir
  2023-06-15 11:40 ` [PATCH AUTOSEL 4.14 4/6] nfcsim.c: Fix error checking for debugfs_create_dir Sasha Levin
@ 2023-06-16 19:35   ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2023-06-16 19:35 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Osama Muhammad, Simon Horman,
	David S . Miller, krzysztof.kozlowski, netdev

[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

Hi!

> [ Upstream commit 9b9e46aa07273ceb96866b2e812b46f1ee0b8d2f ]
> 
> This patch fixes the error checking in nfcsim.c.
> The DebugFS kernel API is developed in
> a way that the caller can safely ignore the errors that
> occur during the creation of DebugFS nodes.

I don't think this is good idea; user will wonder why he can't see
debugfs files, and pr_err() is quite suitable way to handle this.

Anyway, this does not really fix a bug, so we should not be putting it
into stable.

Best regards,
								Pavel

>  drivers/nfc/nfcsim.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c
> index 533e3aa6275cd..cf07b366500e9 100644
> --- a/drivers/nfc/nfcsim.c
> +++ b/drivers/nfc/nfcsim.c
> @@ -345,10 +345,6 @@ static struct dentry *nfcsim_debugfs_root;
>  static void nfcsim_debugfs_init(void)
>  {
>  	nfcsim_debugfs_root = debugfs_create_dir("nfcsim", NULL);
> -
> -	if (!nfcsim_debugfs_root)
> -		pr_err("Could not create debugfs entry\n");
> -
>  }
>  
>  static void nfcsim_debugfs_remove(void)

-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

end of thread, other threads:[~2023-06-16 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230615114016.649846-1-sashal@kernel.org>
2023-06-15 11:40 ` [PATCH AUTOSEL 4.14 4/6] nfcsim.c: Fix error checking for debugfs_create_dir Sasha Levin
2023-06-16 19:35   ` Pavel Machek

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