linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro
       [not found] <7a1e8142cb4944ee95cea13e7efad23d@irsmsx602.ger.corp.intel.com>
@ 2020-09-24  5:00 ` Giovanni Cabiddu
  2020-09-25  8:14   ` Herbert Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Giovanni Cabiddu @ 2020-09-24  5:00 UTC (permalink / raw)
  To: Liu Shixin
  Cc: Herbert Xu, David S . Miller, qat-linux, linux-crypto, linux-kernel

On Wed, Sep 16, 2020 at 03:50:17AM +0100, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>

Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>

> ---
>  drivers/crypto/qat/qat_common/adf_cfg.c       | 19 +--------
>  .../qat/qat_common/adf_transport_debug.c      | 42 ++-----------------
>  2 files changed, 5 insertions(+), 56 deletions(-)
> 
> diff --git a/drivers/crypto/qat/qat_common/adf_cfg.c b/drivers/crypto/qat/qat_common/adf_cfg.c
> index ac462796cefc..22ae32838113 100644
> --- a/drivers/crypto/qat/qat_common/adf_cfg.c
> +++ b/drivers/crypto/qat/qat_common/adf_cfg.c
> @@ -52,24 +52,7 @@ static const struct seq_operations qat_dev_cfg_sops = {
>  	.show = qat_dev_cfg_show
>  };
>  
> -static int qat_dev_cfg_open(struct inode *inode, struct file *file)
> -{
> -	int ret = seq_open(file, &qat_dev_cfg_sops);
> -
> -	if (!ret) {
> -		struct seq_file *seq_f = file->private_data;
> -
> -		seq_f->private = inode->i_private;
> -	}
> -	return ret;
> -}
> -
> -static const struct file_operations qat_dev_cfg_fops = {
> -	.open = qat_dev_cfg_open,
> -	.read = seq_read,
> -	.llseek = seq_lseek,
> -	.release = seq_release
> -};
> +DEFINE_SEQ_ATTRIBUTE(qat_dev_cfg);
>  
>  /**
>   * adf_cfg_dev_add() - Create an acceleration device configuration table.
> diff --git a/drivers/crypto/qat/qat_common/adf_transport_debug.c b/drivers/crypto/qat/qat_common/adf_transport_debug.c
> index 2a2eccbf56ec..dac25ba47260 100644
> --- a/drivers/crypto/qat/qat_common/adf_transport_debug.c
> +++ b/drivers/crypto/qat/qat_common/adf_transport_debug.c
> @@ -77,31 +77,14 @@ static void adf_ring_stop(struct seq_file *sfile, void *v)
>  	mutex_unlock(&ring_read_lock);
>  }
>  
> -static const struct seq_operations adf_ring_sops = {
> +static const struct seq_operations adf_ring_debug_sops = {
>  	.start = adf_ring_start,
>  	.next = adf_ring_next,
>  	.stop = adf_ring_stop,
>  	.show = adf_ring_show
>  };
>  
> -static int adf_ring_open(struct inode *inode, struct file *file)
> -{
> -	int ret = seq_open(file, &adf_ring_sops);
> -
> -	if (!ret) {
> -		struct seq_file *seq_f = file->private_data;
> -
> -		seq_f->private = inode->i_private;
> -	}
> -	return ret;
> -}
> -
> -static const struct file_operations adf_ring_debug_fops = {
> -	.open = adf_ring_open,
> -	.read = seq_read,
> -	.llseek = seq_lseek,
> -	.release = seq_release
> -};
> +DEFINE_SEQ_ATTRIBUTE(adf_ring_debug);
>  
>  int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name)
>  {
> @@ -188,31 +171,14 @@ static void adf_bank_stop(struct seq_file *sfile, void *v)
>  	mutex_unlock(&bank_read_lock);
>  }
>  
> -static const struct seq_operations adf_bank_sops = {
> +static const struct seq_operations adf_bank_debug_sops = {
>  	.start = adf_bank_start,
>  	.next = adf_bank_next,
>  	.stop = adf_bank_stop,
>  	.show = adf_bank_show
>  };
>  
> -static int adf_bank_open(struct inode *inode, struct file *file)
> -{
> -	int ret = seq_open(file, &adf_bank_sops);
> -
> -	if (!ret) {
> -		struct seq_file *seq_f = file->private_data;
> -
> -		seq_f->private = inode->i_private;
> -	}
> -	return ret;
> -}
> -
> -static const struct file_operations adf_bank_debug_fops = {
> -	.open = adf_bank_open,
> -	.read = seq_read,
> -	.llseek = seq_lseek,
> -	.release = seq_release
> -};
> +DEFINE_SEQ_ATTRIBUTE(adf_bank_debug);
>  
>  int adf_bank_debugfs_add(struct adf_etr_bank_data *bank)
>  {
> -- 
> 2.25.1
> 

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

* Re: [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-24  5:00 ` [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro Giovanni Cabiddu
@ 2020-09-25  8:14   ` Herbert Xu
  2020-09-25  8:49     ` Giovanni Cabiddu
  0 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2020-09-25  8:14 UTC (permalink / raw)
  To: Giovanni Cabiddu
  Cc: Liu Shixin, David S . Miller, qat-linux, linux-crypto, linux-kernel

On Thu, Sep 24, 2020 at 06:00:42AM +0100, Giovanni Cabiddu wrote:
> On Wed, Sep 16, 2020 at 03:50:17AM +0100, Liu Shixin wrote:
> > Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
> > 
> > Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> 
> Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>

Hi Giovanni:

Your acks are not making it to patchwork, seemingly because your
emails have a bogus References header with an Intel message ID
instead of the original message ID of the email you're replying
to.

I've added your acks manually for this patch but please fix your
emails as I can't guarantee that I'll spot the problem every time.

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: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-25  8:14   ` Herbert Xu
@ 2020-09-25  8:49     ` Giovanni Cabiddu
  0 siblings, 0 replies; 5+ messages in thread
From: Giovanni Cabiddu @ 2020-09-25  8:49 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Liu Shixin, David S . Miller, qat-linux, linux-crypto, linux-kernel

On Fri, Sep 25, 2020 at 06:14:45PM +1000, Herbert Xu wrote:
> On Thu, Sep 24, 2020 at 06:00:42AM +0100, Giovanni Cabiddu wrote:
> > On Wed, Sep 16, 2020 at 03:50:17AM +0100, Liu Shixin wrote:
> > > Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
> > > 
> > > Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> > 
> > Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
> 
> Hi Giovanni:
> 
> Your acks are not making it to patchwork, seemingly because your
> emails have a bogus References header with an Intel message ID
> instead of the original message ID of the email you're replying
> to.
> 
> I've added your acks manually for this patch but please fix your
> emails as I can't guarantee that I'll spot the problem every time.
> 
> Thanks,

Hi Herbert,

Thanks.

I just realized I replied to emails resent from qat-linux therefore the
bogus References header.
I'll make sure I'll be replying to the correct email next time.

Regards,

-- 
Giovanni

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

* Re: [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-16  2:50 Liu Shixin
@ 2020-09-25  8:11 ` Herbert Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2020-09-25  8:11 UTC (permalink / raw)
  To: Liu Shixin
  Cc: Giovanni Cabiddu, David S . Miller, qat-linux, linux-crypto,
	linux-kernel

On Wed, Sep 16, 2020 at 10:50:17AM +0800, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>  drivers/crypto/qat/qat_common/adf_cfg.c       | 19 +--------
>  .../qat/qat_common/adf_transport_debug.c      | 42 ++-----------------
>  2 files changed, 5 insertions(+), 56 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] 5+ messages in thread

* [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro
@ 2020-09-16  2:50 Liu Shixin
  2020-09-25  8:11 ` Herbert Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Liu Shixin @ 2020-09-16  2:50 UTC (permalink / raw)
  To: Giovanni Cabiddu, Herbert Xu, David S . Miller
  Cc: qat-linux, linux-crypto, linux-kernel, Liu Shixin

Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/crypto/qat/qat_common/adf_cfg.c       | 19 +--------
 .../qat/qat_common/adf_transport_debug.c      | 42 ++-----------------
 2 files changed, 5 insertions(+), 56 deletions(-)

diff --git a/drivers/crypto/qat/qat_common/adf_cfg.c b/drivers/crypto/qat/qat_common/adf_cfg.c
index ac462796cefc..22ae32838113 100644
--- a/drivers/crypto/qat/qat_common/adf_cfg.c
+++ b/drivers/crypto/qat/qat_common/adf_cfg.c
@@ -52,24 +52,7 @@ static const struct seq_operations qat_dev_cfg_sops = {
 	.show = qat_dev_cfg_show
 };
 
-static int qat_dev_cfg_open(struct inode *inode, struct file *file)
-{
-	int ret = seq_open(file, &qat_dev_cfg_sops);
-
-	if (!ret) {
-		struct seq_file *seq_f = file->private_data;
-
-		seq_f->private = inode->i_private;
-	}
-	return ret;
-}
-
-static const struct file_operations qat_dev_cfg_fops = {
-	.open = qat_dev_cfg_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = seq_release
-};
+DEFINE_SEQ_ATTRIBUTE(qat_dev_cfg);
 
 /**
  * adf_cfg_dev_add() - Create an acceleration device configuration table.
diff --git a/drivers/crypto/qat/qat_common/adf_transport_debug.c b/drivers/crypto/qat/qat_common/adf_transport_debug.c
index 2a2eccbf56ec..dac25ba47260 100644
--- a/drivers/crypto/qat/qat_common/adf_transport_debug.c
+++ b/drivers/crypto/qat/qat_common/adf_transport_debug.c
@@ -77,31 +77,14 @@ static void adf_ring_stop(struct seq_file *sfile, void *v)
 	mutex_unlock(&ring_read_lock);
 }
 
-static const struct seq_operations adf_ring_sops = {
+static const struct seq_operations adf_ring_debug_sops = {
 	.start = adf_ring_start,
 	.next = adf_ring_next,
 	.stop = adf_ring_stop,
 	.show = adf_ring_show
 };
 
-static int adf_ring_open(struct inode *inode, struct file *file)
-{
-	int ret = seq_open(file, &adf_ring_sops);
-
-	if (!ret) {
-		struct seq_file *seq_f = file->private_data;
-
-		seq_f->private = inode->i_private;
-	}
-	return ret;
-}
-
-static const struct file_operations adf_ring_debug_fops = {
-	.open = adf_ring_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = seq_release
-};
+DEFINE_SEQ_ATTRIBUTE(adf_ring_debug);
 
 int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name)
 {
@@ -188,31 +171,14 @@ static void adf_bank_stop(struct seq_file *sfile, void *v)
 	mutex_unlock(&bank_read_lock);
 }
 
-static const struct seq_operations adf_bank_sops = {
+static const struct seq_operations adf_bank_debug_sops = {
 	.start = adf_bank_start,
 	.next = adf_bank_next,
 	.stop = adf_bank_stop,
 	.show = adf_bank_show
 };
 
-static int adf_bank_open(struct inode *inode, struct file *file)
-{
-	int ret = seq_open(file, &adf_bank_sops);
-
-	if (!ret) {
-		struct seq_file *seq_f = file->private_data;
-
-		seq_f->private = inode->i_private;
-	}
-	return ret;
-}
-
-static const struct file_operations adf_bank_debug_fops = {
-	.open = adf_bank_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = seq_release
-};
+DEFINE_SEQ_ATTRIBUTE(adf_bank_debug);
 
 int adf_bank_debugfs_add(struct adf_etr_bank_data *bank)
 {
-- 
2.25.1


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <7a1e8142cb4944ee95cea13e7efad23d@irsmsx602.ger.corp.intel.com>
2020-09-24  5:00 ` [PATCH -next] crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro Giovanni Cabiddu
2020-09-25  8:14   ` Herbert Xu
2020-09-25  8:49     ` Giovanni Cabiddu
2020-09-16  2:50 Liu Shixin
2020-09-25  8:11 ` 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).