Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
@ 2020-07-16  9:04 Qinglang Miao
  2020-07-20 12:01 ` Horia Geantă
  0 siblings, 1 reply; 5+ messages in thread
From: Qinglang Miao @ 2020-07-16  9:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Horia Geantă, Aymen Sghaier
  Cc: linux-crypto, linux-kernel

From: Liu Shixin <liushixin2@huawei.com>

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 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 aa10841b6..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_iter = seq_read_iter,
-	.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.17.1


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

* Re: [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-07-16  9:04 [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
@ 2020-07-20 12:01 ` Horia Geantă
  2020-07-23  7:25   ` Herbert Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Horia Geantă @ 2020-07-20 12:01 UTC (permalink / raw)
  To: Qinglang Miao, Greg Kroah-Hartman, Aymen Sghaier
  Cc: linux-crypto, linux-kernel

On 7/16/2020 12:00 PM, Qinglang Miao wrote:
> From: Liu Shixin <liushixin2@huawei.com>
> 
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

This patch depends on linux-next
commit 4d4901c6d748 ("seq_file: switch over direct seq_read method calls to seq_read_iter")

Horia

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

* Re: [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-07-20 12:01 ` Horia Geantă
@ 2020-07-23  7:25   ` Herbert Xu
  2020-07-25  9:00     ` miaoqinglang
  0 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2020-07-23  7:25 UTC (permalink / raw)
  To: Horia Geantă
  Cc: miaoqinglang, gregkh, aymen.sghaier, linux-crypto, linux-kernel

Horia Geantă <horia.geanta@nxp.com> wrote:
> On 7/16/2020 12:00 PM, Qinglang Miao wrote:
>> From: Liu Shixin <liushixin2@huawei.com>
>> 
>> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>> 
>> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
> 
> This patch depends on linux-next
> commit 4d4901c6d748 ("seq_file: switch over direct seq_read method calls to seq_read_iter")

Please postpone these cleanups until that patch hits mainline.

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] 5+ messages in thread

* Re: [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-07-23  7:25   ` Herbert Xu
@ 2020-07-25  9:00     ` miaoqinglang
  2020-07-25 12:05       ` Herbert Xu
  0 siblings, 1 reply; 5+ messages in thread
From: miaoqinglang @ 2020-07-25  9:00 UTC (permalink / raw)
  To: Herbert Xu, Horia Geantă
  Cc: gregkh, aymen.sghaier, linux-crypto, linux-kernel



在 2020/7/23 15:25, Herbert Xu 写道:
> Horia Geantă <horia.geanta@nxp.com> wrote:
>> On 7/16/2020 12:00 PM, Qinglang Miao wrote:
>>> From: Liu Shixin <liushixin2@huawei.com>
>>>
>>> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>>>
>>> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
>> Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
>>
>> This patch depends on linux-next
>> commit 4d4901c6d748 ("seq_file: switch over direct seq_read method calls to seq_read_iter")
> 
> Please postpone these cleanups until that patch hits mainline.
> 
> Thanks,
> 
Hi Horia,

I'm agree with what you said and I would repostpone these patch when it 
hits mainline.

Or If you don't mind, I can resend a patch besed on mainline rather than 
-next now.

Thanks,

Qinglang.


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

* Re: [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE
  2020-07-25  9:00     ` miaoqinglang
@ 2020-07-25 12:05       ` Herbert Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2020-07-25 12:05 UTC (permalink / raw)
  To: miaoqinglang
  Cc: Horia Geantă, gregkh, aymen.sghaier, linux-crypto, linux-kernel

On Sat, Jul 25, 2020 at 05:00:02PM +0800, miaoqinglang wrote:
> 
> Or If you don't mind, I can resend a patch besed on mainline rather than
> -next now.

Please don't as that will just cause more conflicts.

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] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16  9:04 [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
2020-07-20 12:01 ` Horia Geantă
2020-07-23  7:25   ` Herbert Xu
2020-07-25  9:00     ` miaoqinglang
2020-07-25 12:05       ` Herbert Xu

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git