mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Suman Kumar Chakraborty <suman.kumar.chakraborty@intel.com>,
	Karthikeyan Gopal <karthikeyan.gopal@intel.com>,
	<qat-linux@intel.com>, <linux-crypto@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] crypto: qat - simplify adf_service_mask_to_string helper
Date: Thu, 4 Jun 2026 22:15:21 +0100	[thread overview]
Message-ID: <aiHq6ZMkZbH3ehQ+@gcabiddu-mobl.ger.corp.intel.com> (raw)
In-Reply-To: <20260527174655.1390543-3-thorsten.blum@linux.dev>

On Wed, May 27, 2026 at 07:46:55PM +0200, Thorsten Blum wrote:
> Use a single scnprintf() for each set bit and drop the offset in the
> else branch to simplify adf_service_mask_to_string().
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>

> ---
>  drivers/crypto/intel/qat/qat_common/adf_cfg_services.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/intel/qat/qat_common/adf_cfg_services.c b/drivers/crypto/intel/qat/qat_common/adf_cfg_services.c
> index 21b21ac78e53..baf563c6f9b7 100644
> --- a/drivers/crypto/intel/qat/qat_common/adf_cfg_services.c
> +++ b/drivers/crypto/intel/qat/qat_common/adf_cfg_services.c
> @@ -93,10 +93,9 @@ static int adf_service_mask_to_string(unsigned long mask, char *buf, size_t len)
>  	for_each_set_bit(bit, &mask, SVC_COUNT) {
>  		if (offset)
>  			offset += scnprintf(buf + offset, len - offset,
> -					    ADF_SERVICES_DELIMITER);
> -
> -		offset += scnprintf(buf + offset, len - offset, "%s",
> -				    adf_cfg_services[bit]);
> +				ADF_SERVICES_DELIMITER "%s", adf_cfg_services[bit]);
> +		else
> +			offset += scnprintf(buf, len, "%s", adf_cfg_services[bit]);
>  	}
>  
>  	return 0;

  reply	other threads:[~2026-06-04 21:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 17:46 Thorsten Blum
2026-06-04 21:15 ` Giovanni Cabiddu [this message]
2026-06-05 11:42 ` Herbert Xu

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=aiHq6ZMkZbH3ehQ+@gcabiddu-mobl.ger.corp.intel.com \
    --to=giovanni.cabiddu@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=karthikeyan.gopal@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qat-linux@intel.com \
    --cc=suman.kumar.chakraborty@intel.com \
    --cc=thorsten.blum@linux.dev \
    /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

all inboxes | Powered by JetHome®