[PATCH v2 2/2] lib/hash: avoid implicit conversion to 64 bit number
Morten Brørup
mb at smartsharesystems.com
Mon Jan 27 18:16:29 CET 2025
> From: Andre Muezerie [mailto:andremue at linux.microsoft.com]
> Sent: Monday, 27 January 2025 17.04
>
> MSVC issues the warnings below:
>
> 1) ../lib/hash/rte_thash_gf2_poly_math.c(128): warning C4334: '<<':
> result of 32-bit shift implicitly converted to 64 bits
> (was 64-bit shift intended?)
>
> The code would be better off by using 64 bit numbers to begin with.
> That eliminates the need for a conversion to 64 bits later.
>
> 2) ../lib/hash/rte_thash.c(568): warning C4334: '<<':
> result of 32-bit shift implicitly converted to 64 bits
> (was 64-bit shift intended?)
>
> Instead of multiplying sizeof(uint32_t) by the result of shifting
> "1", sizeof(uint32_t) can be shifted directly.
>
> Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
> Acked-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
> Acked-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
Reviewed-by: Morten Brørup <mb at smartsharesystems.com>
More information about the dev
mailing list