Skip to content

Commit a92f7af

Browse files
fabioestevamherbertx
authored andcommitted
crypto: caam - Remove unused dentry members
Most of the dentry members from structure caam_drv_private are never used at all, so it is safe to remove them. Since debugfs_remove_recursive() is called, we don't need the file entries. Signed-off-by: Fabio Estevam <[email protected]> Acked-by: Horia Geantă <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent ac360fa commit a92f7af

File tree

3 files changed

+32
-63
lines changed

3 files changed

+32
-63
lines changed

drivers/crypto/caam/ctrl.c

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -747,59 +747,38 @@ static int caam_probe(struct platform_device *pdev)
747747
caam_dpaa2 ? "yes" : "no");
748748

749749
#ifdef CONFIG_DEBUG_FS
750-
751-
ctrlpriv->ctl_rq_dequeued =
752-
debugfs_create_file("rq_dequeued",
753-
S_IRUSR | S_IRGRP | S_IROTH,
754-
ctrlpriv->ctl, &perfmon->req_dequeued,
755-
&caam_fops_u64_ro);
756-
ctrlpriv->ctl_ob_enc_req =
757-
debugfs_create_file("ob_rq_encrypted",
758-
S_IRUSR | S_IRGRP | S_IROTH,
759-
ctrlpriv->ctl, &perfmon->ob_enc_req,
760-
&caam_fops_u64_ro);
761-
ctrlpriv->ctl_ib_dec_req =
762-
debugfs_create_file("ib_rq_decrypted",
763-
S_IRUSR | S_IRGRP | S_IROTH,
764-
ctrlpriv->ctl, &perfmon->ib_dec_req,
765-
&caam_fops_u64_ro);
766-
ctrlpriv->ctl_ob_enc_bytes =
767-
debugfs_create_file("ob_bytes_encrypted",
768-
S_IRUSR | S_IRGRP | S_IROTH,
769-
ctrlpriv->ctl, &perfmon->ob_enc_bytes,
770-
&caam_fops_u64_ro);
771-
ctrlpriv->ctl_ob_prot_bytes =
772-
debugfs_create_file("ob_bytes_protected",
773-
S_IRUSR | S_IRGRP | S_IROTH,
774-
ctrlpriv->ctl, &perfmon->ob_prot_bytes,
775-
&caam_fops_u64_ro);
776-
ctrlpriv->ctl_ib_dec_bytes =
777-
debugfs_create_file("ib_bytes_decrypted",
778-
S_IRUSR | S_IRGRP | S_IROTH,
779-
ctrlpriv->ctl, &perfmon->ib_dec_bytes,
780-
&caam_fops_u64_ro);
781-
ctrlpriv->ctl_ib_valid_bytes =
782-
debugfs_create_file("ib_bytes_validated",
783-
S_IRUSR | S_IRGRP | S_IROTH,
784-
ctrlpriv->ctl, &perfmon->ib_valid_bytes,
785-
&caam_fops_u64_ro);
750+
debugfs_create_file("rq_dequeued", S_IRUSR | S_IRGRP | S_IROTH,
751+
ctrlpriv->ctl, &perfmon->req_dequeued,
752+
&caam_fops_u64_ro);
753+
debugfs_create_file("ob_rq_encrypted", S_IRUSR | S_IRGRP | S_IROTH,
754+
ctrlpriv->ctl, &perfmon->ob_enc_req,
755+
&caam_fops_u64_ro);
756+
debugfs_create_file("ib_rq_decrypted", S_IRUSR | S_IRGRP | S_IROTH,
757+
ctrlpriv->ctl, &perfmon->ib_dec_req,
758+
&caam_fops_u64_ro);
759+
debugfs_create_file("ob_bytes_encrypted", S_IRUSR | S_IRGRP | S_IROTH,
760+
ctrlpriv->ctl, &perfmon->ob_enc_bytes,
761+
&caam_fops_u64_ro);
762+
debugfs_create_file("ob_bytes_protected", S_IRUSR | S_IRGRP | S_IROTH,
763+
ctrlpriv->ctl, &perfmon->ob_prot_bytes,
764+
&caam_fops_u64_ro);
765+
debugfs_create_file("ib_bytes_decrypted", S_IRUSR | S_IRGRP | S_IROTH,
766+
ctrlpriv->ctl, &perfmon->ib_dec_bytes,
767+
&caam_fops_u64_ro);
768+
debugfs_create_file("ib_bytes_validated", S_IRUSR | S_IRGRP | S_IROTH,
769+
ctrlpriv->ctl, &perfmon->ib_valid_bytes,
770+
&caam_fops_u64_ro);
786771

787772
/* Controller level - global status values */
788-
ctrlpriv->ctl_faultaddr =
789-
debugfs_create_file("fault_addr",
790-
S_IRUSR | S_IRGRP | S_IROTH,
791-
ctrlpriv->ctl, &perfmon->faultaddr,
792-
&caam_fops_u32_ro);
793-
ctrlpriv->ctl_faultdetail =
794-
debugfs_create_file("fault_detail",
795-
S_IRUSR | S_IRGRP | S_IROTH,
796-
ctrlpriv->ctl, &perfmon->faultdetail,
797-
&caam_fops_u32_ro);
798-
ctrlpriv->ctl_faultstatus =
799-
debugfs_create_file("fault_status",
800-
S_IRUSR | S_IRGRP | S_IROTH,
801-
ctrlpriv->ctl, &perfmon->status,
802-
&caam_fops_u32_ro);
773+
debugfs_create_file("fault_addr", S_IRUSR | S_IRGRP | S_IROTH,
774+
ctrlpriv->ctl, &perfmon->faultaddr,
775+
&caam_fops_u32_ro);
776+
debugfs_create_file("fault_detail", S_IRUSR | S_IRGRP | S_IROTH,
777+
ctrlpriv->ctl, &perfmon->faultdetail,
778+
&caam_fops_u32_ro);
779+
debugfs_create_file("fault_status", S_IRUSR | S_IRGRP | S_IROTH,
780+
ctrlpriv->ctl, &perfmon->status,
781+
&caam_fops_u32_ro);
803782

804783
/* Internal covering keys (useful in non-secure mode only) */
805784
ctrlpriv->ctl_kek_wrap.data = (__force void *)&ctrlpriv->ctrl->kek[0];

drivers/crypto/caam/intern.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,8 @@ struct caam_drv_private {
102102
#ifdef CONFIG_DEBUG_FS
103103
struct dentry *dfs_root;
104104
struct dentry *ctl; /* controller dir */
105-
struct dentry *ctl_rq_dequeued, *ctl_ob_enc_req, *ctl_ib_dec_req;
106-
struct dentry *ctl_ob_enc_bytes, *ctl_ob_prot_bytes;
107-
struct dentry *ctl_ib_dec_bytes, *ctl_ib_valid_bytes;
108-
struct dentry *ctl_faultaddr, *ctl_faultdetail, *ctl_faultstatus;
109-
110105
struct debugfs_blob_wrapper ctl_kek_wrap, ctl_tkek_wrap, ctl_tdsk_wrap;
111106
struct dentry *ctl_kek, *ctl_tkek, *ctl_tdsk;
112-
#ifdef CONFIG_CAAM_QI
113-
struct dentry *qi_congested;
114-
#endif
115107
#endif
116108
};
117109

drivers/crypto/caam/qi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -791,10 +791,8 @@ int caam_qi_init(struct platform_device *caam_pdev)
791791
/* Done with the CGRs; restore the cpus allowed mask */
792792
set_cpus_allowed_ptr(current, &old_cpumask);
793793
#ifdef CONFIG_DEBUG_FS
794-
ctrlpriv->qi_congested = debugfs_create_file("qi_congested", 0444,
795-
ctrlpriv->ctl,
796-
&times_congested,
797-
&caam_fops_u64_ro);
794+
debugfs_create_file("qi_congested", 0444, ctrlpriv->ctl,
795+
&times_congested, &caam_fops_u64_ro);
798796
#endif
799797
dev_info(qidev, "Linux CAAM Queue I/F driver initialised\n");
800798
return 0;

0 commit comments

Comments
 (0)