public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
To: You Kangren <youkangren@vivo.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Adam Guerin <adam.guerin@intel.com>,
	Damian Muszynski <damian.muszynski@intel.com>,
	Srinivas Kerekare <srinivas.kerekare@intel.com>,
	"Bruce W. Allan" <bruce.w.allan@intel.com>,
	Pingchaox Yang <pingchaox.yang@intel.com>,
	Bo Cui <bo.cui@intel.com>, Karen Xiang <karen.xiang@intel.com>,
	"open list:QAT DRIVER" <qat-linux@intel.com>,
	"open list:CRYPTO API" <linux-crypto@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	<opensource.kernel@vivo.com>, <luhongfei@vivo.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v5] crypto: qat - Replace the if statement with min()
Date: Tue, 4 Jul 2023 11:53:36 +0100	[thread overview]
Message-ID: <ZKP6MKGIUnX76Myb@gcabiddu-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20230704094208.642-1-youkangren@vivo.com>

On Tue, Jul 04, 2023 at 05:42:07PM +0800, You Kangren wrote:
> Mark UWORD_CPYBUF_SIZE with U suffix to make its type the same with
> words_num and replace the if statement with min() in
I would separate this in two sentences.

> qat_uclo_wr_uimage_raw_page() to make code shorter.
> 
> Fixes: b4b7e67c917f ("crypto: qat - Intel(R) QAT ucode part of fw loader")
Why is this a fix?

NIT. On the headline of the commit message. Lower case after `-`.
See
    git log --pretty=oneline drivers/crypto/intel/qat/

BTW, you could reuse the commit message I proposed when I reworked the
same.

Regards,

-- 
Giovanni

> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: You Kangren <youkangren@vivo.com>
> ---
> Changelog:
> v4->v5: 
> - Add the Fixes and Reviewed-by tags of the patch
> - Add the version update information of the patch
> 
> v3->v4:
> - Remove the header file <linux/minmax.h> in v3
> 
> v2->v3:
> - Add a header file <linux/minmax.h>
> - Mark UWORD_CPYBUF_SIZE with U suffix
> - Change min_t() to min() in qat_uclo_wr_uimage_raw_page()
> 
> v1->v2:
> - Change min() to min_t() in qat_uclo_wr_uimage_raw_page()
>  
>  drivers/crypto/intel/qat/qat_common/qat_uclo.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/crypto/intel/qat/qat_common/qat_uclo.c b/drivers/crypto/intel/qat/qat_common/qat_uclo.c
> index ce837bcc1cab..4bd150d1441a 100644
> --- a/drivers/crypto/intel/qat/qat_common/qat_uclo.c
> +++ b/drivers/crypto/intel/qat/qat_common/qat_uclo.c
> @@ -11,7 +11,7 @@
>  #include "icp_qat_hal.h"
>  #include "icp_qat_fw_loader_handle.h"
>  
> -#define UWORD_CPYBUF_SIZE 1024
> +#define UWORD_CPYBUF_SIZE 1024U
>  #define INVLD_UWORD 0xffffffffffull
>  #define PID_MINOR_REV 0xf
>  #define PID_MAJOR_REV (0xf << 4)
> @@ -1986,10 +1986,7 @@ static void qat_uclo_wr_uimage_raw_page(struct icp_qat_fw_loader_handle *handle,
>  	uw_relative_addr = 0;
>  	words_num = encap_page->micro_words_num;
>  	while (words_num) {
> -		if (words_num < UWORD_CPYBUF_SIZE)
> -			cpylen = words_num;
> -		else
> -			cpylen = UWORD_CPYBUF_SIZE;
> +		cpylen = min(words_num, UWORD_CPYBUF_SIZE);
>  
>  		/* load the buffer */
>  		for (i = 0; i < cpylen; i++)
> -- 
> 2.39.0
> 

      parent reply	other threads:[~2023-07-04 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04  9:42 [PATCH v5] crypto: qat - Replace the if statement with min() You Kangren
2023-07-04  9:49 ` Andy Shevchenko
2023-07-04 10:53 ` Giovanni Cabiddu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZKP6MKGIUnX76Myb@gcabiddu-mobl1.ger.corp.intel.com \
    --to=giovanni.cabiddu@intel.com \
    --cc=adam.guerin@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bo.cui@intel.com \
    --cc=bruce.w.allan@intel.com \
    --cc=damian.muszynski@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=karen.xiang@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luhongfei@vivo.com \
    --cc=opensource.kernel@vivo.com \
    --cc=pingchaox.yang@intel.com \
    --cc=qat-linux@intel.com \
    --cc=srinivas.kerekare@intel.com \
    --cc=tom.zanussi@linux.intel.com \
    --cc=youkangren@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox