public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Jack Xu <jack.xu@intel.com>,
	Suman Kumar Chakraborty <suman.kumar.chakraborty@intel.com>,
	Qianfeng Rong <rongqianfeng@vivo.com>,
	qat-linux@intel.com, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] crypto: qat - use simple_strtoull to improve qat_uclo_parse_num
Date: Mon, 27 Oct 2025 11:02:16 +0200	[thread overview]
Message-ID: <aP81GIlKmMv4pW-8@smile.fi.intel.com> (raw)
In-Reply-To: <20251026015710.1368-1-thorsten.blum@linux.dev>

On Sun, Oct 26, 2025 at 02:57:07AM +0100, Thorsten Blum wrote:
> Replace the manual string copying and parsing logic with a call to
> simple_strtoull() to simplify and improve qat_uclo_parse_num().
> 
> Ensure that the parsed number does not exceed UINT_MAX, and add an
> approximate upper-bound check (no more than 19 digits) to guard against
> overflow.

Reviewed-by; Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> ---
> Changes in v2:
> - Use simple_strtoull(), return -EINVAL, and guard against overflow as
>   suggested by Andy

(some) overflows :-) But at least it keeps the code on par with the original.

And we ignore false positive (in this case!) checkpatch warning.

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2025-10-27  9:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-26  1:57 [PATCH v2] crypto: qat - use simple_strtoull to improve qat_uclo_parse_num Thorsten Blum
2025-10-27  8:47 ` Giovanni Cabiddu
2025-10-27  9:02 ` Andy Shevchenko [this message]
2025-10-30 11:27   ` Giovanni Cabiddu
2025-10-30 14:03     ` Andy Shevchenko
2025-10-30 14:10       ` Giovanni Cabiddu
2025-10-30 17:41         ` Andy Shevchenko
2025-10-31  9:51 ` 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=aP81GIlKmMv4pW-8@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jack.xu@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qat-linux@intel.com \
    --cc=rongqianfeng@vivo.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