]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
crypto: caam - Remove unused dentry members
authorFabio Estevam <festevam@gmail.com>
Tue, 1 Aug 2017 13:45:01 +0000 (10:45 -0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 9 Aug 2017 12:18:29 +0000 (20:18 +0800)
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 <festevam@gmail.com>
Acked-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/ctrl.c
drivers/crypto/caam/intern.h
drivers/crypto/caam/qi.c

index fdbcba13824c2cafd9062e448225c39312f61e08..dacb53fb690e9583323500333de5d74be3af20f5 100644 (file)
@@ -747,59 +747,38 @@ static int caam_probe(struct platform_device *pdev)
                 caam_dpaa2 ? "yes" : "no");
 
 #ifdef CONFIG_DEBUG_FS
-
-       ctrlpriv->ctl_rq_dequeued =
-               debugfs_create_file("rq_dequeued",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->req_dequeued,
-                                   &caam_fops_u64_ro);
-       ctrlpriv->ctl_ob_enc_req =
-               debugfs_create_file("ob_rq_encrypted",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->ob_enc_req,
-                                   &caam_fops_u64_ro);
-       ctrlpriv->ctl_ib_dec_req =
-               debugfs_create_file("ib_rq_decrypted",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->ib_dec_req,
-                                   &caam_fops_u64_ro);
-       ctrlpriv->ctl_ob_enc_bytes =
-               debugfs_create_file("ob_bytes_encrypted",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->ob_enc_bytes,
-                                   &caam_fops_u64_ro);
-       ctrlpriv->ctl_ob_prot_bytes =
-               debugfs_create_file("ob_bytes_protected",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->ob_prot_bytes,
-                                   &caam_fops_u64_ro);
-       ctrlpriv->ctl_ib_dec_bytes =
-               debugfs_create_file("ib_bytes_decrypted",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->ib_dec_bytes,
-                                   &caam_fops_u64_ro);
-       ctrlpriv->ctl_ib_valid_bytes =
-               debugfs_create_file("ib_bytes_validated",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->ib_valid_bytes,
-                                   &caam_fops_u64_ro);
+       debugfs_create_file("rq_dequeued", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->req_dequeued,
+                           &caam_fops_u64_ro);
+       debugfs_create_file("ob_rq_encrypted", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->ob_enc_req,
+                           &caam_fops_u64_ro);
+       debugfs_create_file("ib_rq_decrypted", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->ib_dec_req,
+                           &caam_fops_u64_ro);
+       debugfs_create_file("ob_bytes_encrypted", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->ob_enc_bytes,
+                           &caam_fops_u64_ro);
+       debugfs_create_file("ob_bytes_protected", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->ob_prot_bytes,
+                           &caam_fops_u64_ro);
+       debugfs_create_file("ib_bytes_decrypted", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->ib_dec_bytes,
+                           &caam_fops_u64_ro);
+       debugfs_create_file("ib_bytes_validated", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->ib_valid_bytes,
+                           &caam_fops_u64_ro);
 
        /* Controller level - global status values */
-       ctrlpriv->ctl_faultaddr =
-               debugfs_create_file("fault_addr",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->faultaddr,
-                                   &caam_fops_u32_ro);
-       ctrlpriv->ctl_faultdetail =
-               debugfs_create_file("fault_detail",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->faultdetail,
-                                   &caam_fops_u32_ro);
-       ctrlpriv->ctl_faultstatus =
-               debugfs_create_file("fault_status",
-                                   S_IRUSR | S_IRGRP | S_IROTH,
-                                   ctrlpriv->ctl, &perfmon->status,
-                                   &caam_fops_u32_ro);
+       debugfs_create_file("fault_addr", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->faultaddr,
+                           &caam_fops_u32_ro);
+       debugfs_create_file("fault_detail", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->faultdetail,
+                           &caam_fops_u32_ro);
+       debugfs_create_file("fault_status", S_IRUSR | S_IRGRP | S_IROTH,
+                           ctrlpriv->ctl, &perfmon->status,
+                           &caam_fops_u32_ro);
 
        /* Internal covering keys (useful in non-secure mode only) */
        ctrlpriv->ctl_kek_wrap.data = (__force void *)&ctrlpriv->ctrl->kek[0];
index 9e3f3e0a7ffa1541cc83b0729d1450aff7f11977..a52361258d3a0d0081d0df9c758bea616f8e3da8 100644 (file)
@@ -102,16 +102,8 @@ struct caam_drv_private {
 #ifdef CONFIG_DEBUG_FS
        struct dentry *dfs_root;
        struct dentry *ctl; /* controller dir */
-       struct dentry *ctl_rq_dequeued, *ctl_ob_enc_req, *ctl_ib_dec_req;
-       struct dentry *ctl_ob_enc_bytes, *ctl_ob_prot_bytes;
-       struct dentry *ctl_ib_dec_bytes, *ctl_ib_valid_bytes;
-       struct dentry *ctl_faultaddr, *ctl_faultdetail, *ctl_faultstatus;
-
        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
 };
 
index 9a4151ac5e37ca69fb50d455c372f501318e699b..e4cf00014233121d7086cb81bf551d1bc1528c7e 100644 (file)
@@ -791,10 +791,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;