Skip to contentSkip to conversation

crypto: iaa - Remove unnecessary debugfs_create_dir() error check in iaa_crypto_debugfs_init()

PATCH In review Minjie Du 3 participants 3 messages Jan 9, 2024 – Jan 26, 2024

Subsystems (2)
lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH 1/1 crypto: iaa - Remove unnecessary debugfs_create_dir() error check in iaa_crypto_debugfs_init()

This patch removes the debugfs_create_dir() error checking in iaa_crypto_debugfs_init(). Because the debugfs_create_dir() is developed in a way that the caller can safely handle the errors that occur during the creation of DebugFS nodes.

---
 drivers/crypto/intel/iaa/iaa_crypto_stats.c | 2 --
 1 file changed, 2 deletions(-)
drivers/crypto/intel/iaa/iaa_crypto_stats.c +0 -2
index 2e3b7b73af20..cbf87d0effe3 100644
@@ -275,8 +275,6 @@ int __init iaa_crypto_debugfs_init(void)
 		return -ENODEV;
 
 	iaa_crypto_debugfs_root = debugfs_create_dir("iaa_crypto", NULL);
-	if (!iaa_crypto_debugfs_root)
-		return -ENOMEM;
 
 	debugfs_create_u64("max_comp_delay_ns", 0644,
 			   iaa_crypto_debugfs_root, &max_comp_delay_ns);
Signature · 1 line
2.39.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Minjie Du

This patch removes the debugfs_create_dir() error checking in iaa_crypto_debugfs_init(). Because the debugfs_create_dir() is developed
in a way that the caller can safely handle the errors that occur during the creation of DebugFS nodes.

Thanks Minjie,

Tom

Quoted 20 lines

---
 drivers/crypto/intel/iaa/iaa_crypto_stats.c | 2 --

 1 file changed, 2 deletions(-)
drivers/crypto/intel/iaa/iaa_crypto_stats.c +0 -0
index 2e3b7b73af20..cbf87d0effe3 100644
@@ -275,8 +275,6 @@ int __init iaa_crypto_debugfs_init(void)
                 return -ENODEV;


        iaa_crypto_debugfs_root = debugfs_create_dir("iaa_crypto", NULL);
-       if (!iaa_crypto_debugfs_root)
-               return -ENOMEM;

        debugfs_create_u64("max_comp_delay_ns", 0644, iaa_crypto_debugfs_root, &max_comp_delay_ns);

maintainer
#2 lore raw
In reply to Minjie Du
Quoted 9 lines · Minjie Du

This patch removes the debugfs_create_dir() error checking in iaa_crypto_debugfs_init(). Because the debugfs_create_dir() is developed in a way that the caller can safely handle the errors that occur during the creation of DebugFS nodes.

---
 drivers/crypto/intel/iaa/iaa_crypto_stats.c | 2 --
 1 file changed, 2 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt