Re: [PATCH v2] crypto: qat - use simple_strtoull to improve qat_uclo_parse_num
From: Andy Shevchenko
Date: Mon Oct 27 2025 - 05:12:24 EST
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@xxxxxxxxxxxxxxx>
> ---
> 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