linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
@ 2020-09-18  1:31 Qinglang Miao
  2020-09-20 17:56 ` Horia Geantă
  2020-09-25  8:16 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Qinglang Miao @ 2020-09-18  1:31 UTC (permalink / raw)
  To: Horia Geantă, Aymen Sghaier, Herbert Xu, David S. Miller
  Cc: linux-crypto, linux-kernel, Qinglang Miao

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
v2: based on linux-next(20200917), and can be applied to
    mainline cleanly now.

 drivers/crypto/caam/dpseci-debugfs.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/drivers/crypto/caam/dpseci-debugfs.c b/drivers/crypto/caam/dpseci-debugfs.c
index c5bfc923a..0eca8c2fd 100644
--- a/drivers/crypto/caam/dpseci-debugfs.c
+++ b/drivers/crypto/caam/dpseci-debugfs.c
@@ -44,33 +44,14 @@ static int dpseci_dbg_fqs_show(struct seq_file *file, void *offset)
 	return 0;
 }
 
-static int dpseci_dbg_fqs_open(struct inode *inode, struct file *file)
-{
-	int err;
-	struct dpaa2_caam_priv *priv;
-
-	priv = (struct dpaa2_caam_priv *)inode->i_private;
-
-	err = single_open(file, dpseci_dbg_fqs_show, priv);
-	if (err < 0)
-		dev_err(priv->dev, "single_open() failed\n");
-
-	return err;
-}
-
-static const struct file_operations dpseci_dbg_fq_ops = {
-	.open = dpseci_dbg_fqs_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(dpseci_dbg_fqs);
 
 void dpaa2_dpseci_debugfs_init(struct dpaa2_caam_priv *priv)
 {
 	priv->dfs_root = debugfs_create_dir(dev_name(priv->dev), NULL);
 
 	debugfs_create_file("fq_stats", 0444, priv->dfs_root, priv,
-			    &dpseci_dbg_fq_ops);
+			    &dpseci_dbg_fqs_fops);
 }
 
 void dpaa2_dpseci_debugfs_exit(struct dpaa2_caam_priv *priv)
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-09-18  1:31 [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
@ 2020-09-20 17:56 ` Horia Geantă
  2020-09-25  8:16 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Horia Geantă @ 2020-09-20 17:56 UTC (permalink / raw)
  To: Qinglang Miao, Aymen Sghaier, Herbert Xu, David S. Miller
  Cc: linux-crypto, linux-kernel

On 9/18/2020 4:30 AM, Qinglang Miao wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Thanks,
Horia

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-09-18  1:31 [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
  2020-09-20 17:56 ` Horia Geantă
@ 2020-09-25  8:16 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2020-09-25  8:16 UTC (permalink / raw)
  To: Qinglang Miao
  Cc: Horia Geantă,
	Aymen Sghaier, David S. Miller, linux-crypto, linux-kernel

On Fri, Sep 18, 2020 at 09:31:11AM +0800, Qinglang Miao wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
> v2: based on linux-next(20200917), and can be applied to
>     mainline cleanly now.
> 
>  drivers/crypto/caam/dpseci-debugfs.c | 23 ++---------------------
>  1 file changed, 2 insertions(+), 21 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-25  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18  1:31 [PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
2020-09-20 17:56 ` Horia Geantă
2020-09-25  8:16 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).