Skip to contentSkip to conversation

crypto: caam/qi - Remove unused 'qi_congested' entry

PATCH In review Fabio Estevam 2 participants 3 messages Jul 29, 2017 – Jul 31, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: caam/qi - Remove unused 'qi_congested' entry

From: Fabio Estevam <[email protected]>

'qi_congested' member from structure caam_drv_private is never used at all, so it is safe to remove it.

---
 drivers/crypto/caam/intern.h | 3 ---
 drivers/crypto/caam/qi.c     | 6 ++----
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/crypto/caam/intern.h +0 -3
index 9e3f3e0..9625b2d 100644
@@ -109,9 +109,6 @@ struct caam_drv_private {
 
 	struct debugfs_blob_wrapper ctl_kek_wrap, ctl_tkek_wrap, ctl_tdsk_wrap;
 	struct dentry *ctl_kek, *ctl_tkek, *ctl_tdsk;
-#ifdef CONFIG_CAAM_QI
-	struct dentry *qi_congested;
-#endif
 #endif
 };
 
drivers/crypto/caam/qi.c +2 -4
index 6d5a010..b2f7a42 100644
@@ -793,10 +793,8 @@ int caam_qi_init(struct platform_device *caam_pdev)
 	/* Done with the CGRs; restore the cpus allowed mask */
 	set_cpus_allowed_ptr(current, &old_cpumask);
 #ifdef CONFIG_DEBUG_FS
-	ctrlpriv->qi_congested = debugfs_create_file("qi_congested", 0444,
-						     ctrlpriv->ctl,
-						     &times_congested,
-						     &caam_fops_u64_ro);
+	debugfs_create_file("qi_congested", 0444, ctrlpriv->ctl,
+			    &times_congested, &caam_fops_u64_ro);
 #endif
 	dev_info(qidev, "Linux CAAM Queue I/F driver initialised\n");
 	return 0;
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 4 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

'qi_congested' member from structure caam_drv_private is never used at all, so it is safe to remove it.

Agree, though I would remove all the other dentry members not currently used - since debugfs_remove_recursive() is called, we don't need the file entries.

Quoted 26 lines
---
 drivers/crypto/caam/intern.h | 3 ---
 drivers/crypto/caam/qi.c     | 6 ++----
 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/crypto/caam/intern.h +0 -3
index 9e3f3e0..9625b2d 100644
@@ -109,9 +109,6 @@ struct caam_drv_private {
 
 	struct debugfs_blob_wrapper ctl_kek_wrap, ctl_tkek_wrap, ctl_tdsk_wrap;
 	struct dentry *ctl_kek, *ctl_tkek, *ctl_tdsk;
-#ifdef CONFIG_CAAM_QI
-	struct dentry *qi_congested;
-#endif
 #endif
 };
 
drivers/crypto/caam/qi.c +0 -0
index 6d5a010..b2f7a42 100644

drivers/crypto/caam/qi.c int caam_qi_init(struct platform_device *caam_pdev) · line 797

Quoted 9 lines
drivers/crypto/caam/qi.c +2 -4
@@ -793,10 +793,8 @@ int caam_qi_init(struct platform_device *caam_pdev)
 	/* Done with the CGRs; restore the cpus allowed mask */
 	set_cpus_allowed_ptr(current, &old_cpumask);
 #ifdef CONFIG_DEBUG_FS
-	ctrlpriv->qi_congested = debugfs_create_file("qi_congested", 0444,
-						     ctrlpriv->ctl,
-						     &times_congested,
-						     &caam_fops_u64_ro);
+	debugfs_create_file("qi_congested", 0444, ctrlpriv->ctl,
+			    &times_congested, &caam_fops_u64_ro);

Either here or in a different patch the return value of debugfs_create_* functions should be checked, such that if IS_ERR_OR_NULL(ret) we could print a warning.

Thanks,
Horia

#2 lore raw
Quoted 9 lines · Horia Geantă
Quoted 4 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

'qi_congested' member from structure caam_drv_private is never used at all, so it is safe to remove it.

Agree, though I would remove all the other dentry members not currently used - since debugfs_remove_recursive() is called, we don't need the file entries.

Ok, it makes sense. Wil do it in v2.

Quoted 10 lines
Quoted 10 lines
drivers/crypto/caam/qi.c +0 -2
index 6d5a010..b2f7a42 100644
@@ -793,10 +793,8 @@ int caam_qi_init(struct platform_device *caam_pdev)
      /* Done with the CGRs; restore the cpus allowed mask */
      set_cpus_allowed_ptr(current, &old_cpumask);
 #ifdef CONFIG_DEBUG_FS
-     ctrlpriv->qi_congested = debugfs_create_file("qi_congested", 0444,
-                                                  ctrlpriv->ctl,
Quoted 8 lines

drivers/crypto/caam/qi.c int caam_qi_init(struct platform_device *caam_pdev) · line 797

Quoted 4 lines
drivers/crypto/caam/qi.c +2 -2
-                                                  &times_congested,
-                                                  &caam_fops_u64_ro);
+     debugfs_create_file("qi_congested", 0444, ctrlpriv->ctl,
+                         &times_congested, &caam_fops_u64_ro);

Either here or in a different patch the return value of debugfs_create_* functions should be checked, such that if IS_ERR_OR_NULL(ret) we could print a warning.

I will leave the error checking for a separate patch then.