* [PATCH v2] crypto: caam: Remove unused dentry members
@ 2017-07-31 12:21 Fabio Estevam
2017-08-01 12:24 ` Horia Geantă
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2017-07-31 12:21 UTC (permalink / raw)
To: herbert; +Cc: horia.geanta, linux-crypto, Fabio Estevam
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>
---
Changes since v1:
- Remove all the unused dentry members (Horia)
drivers/crypto/caam/ctrl.c | 81 ++++++++++++++++----------------------------
drivers/crypto/caam/intern.h | 8 -----
drivers/crypto/caam/qi.c | 6 ++--
3 files changed, 32 insertions(+), 63 deletions(-)
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 7338f15..dc65fed 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -734,59 +734,38 @@ static int caam_probe(struct platform_device *pdev)
ctrlpriv->total_jobrs, ctrlpriv->qi_present);
#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];
diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h
index 9e3f3e0..a523612 100644
--- a/drivers/crypto/caam/intern.h
+++ b/drivers/crypto/caam/intern.h
@@ -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
};
diff --git a/drivers/crypto/caam/qi.c b/drivers/crypto/caam/qi.c
index 9a4151a..e4cf000 100644
--- a/drivers/crypto/caam/qi.c
+++ b/drivers/crypto/caam/qi.c
@@ -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,
- ×_congested,
- &caam_fops_u64_ro);
+ debugfs_create_file("qi_congested", 0444, ctrlpriv->ctl,
+ ×_congested, &caam_fops_u64_ro);
#endif
dev_info(qidev, "Linux CAAM Queue I/F driver initialised\n");
return 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] crypto: caam: Remove unused dentry members
2017-07-31 12:21 [PATCH v2] crypto: caam: Remove unused dentry members Fabio Estevam
@ 2017-08-01 12:24 ` Horia Geantă
0 siblings, 0 replies; 2+ messages in thread
From: Horia Geantă @ 2017-08-01 12:24 UTC (permalink / raw)
To: Fabio Estevam, herbert; +Cc: linux-crypto
On 7/31/2017 3:22 PM, Fabio Estevam wrote:
> 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>
> ---
> Changes since v1:
> - Remove all the unused dentry members (Horia)
>
> drivers/crypto/caam/ctrl.c | 81 ++++++++++++++++----------------------------
> drivers/crypto/caam/intern.h | 8 -----
> drivers/crypto/caam/qi.c | 6 ++--
> 3 files changed, 32 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
> index 7338f15..dc65fed 100644
> --- a/drivers/crypto/caam/ctrl.c
> +++ b/drivers/crypto/caam/ctrl.c
> @@ -734,59 +734,38 @@ static int caam_probe(struct platform_device *pdev)
> ctrlpriv->total_jobrs, ctrlpriv->qi_present);
>
> #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,
checkpatch complains here ^
ERROR: space required after that ',' (ctx:VxV)
Regards,
Horia
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-01 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-31 12:21 [PATCH v2] crypto: caam: Remove unused dentry members Fabio Estevam
2017-08-01 12:24 ` Horia Geantă
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.