RE: [PATCH 1/1] EDAC/i10nm: Fix the bitwise operation between variables of different sizes
From: Luck, Tony
Date: Thu Apr 24 2025 - 11:47:37 EST
> The tool of Smatch static checker reported the following warning:
>
> drivers/edac/i10nm_base.c:364 show_retry_rd_err_log()
> warn: should bitwise negate be 'ullong'?
>
> This warning was due to the bitwise NOT/AND operations between
> 'status_mask' (a u32 type) and 'log' (a u64 type), which resulted in
> the high 32 bits of 'log' were cleared.
>
> This was a false positive warning, as only the low 32 bits of 'log' was
> written to the first RRL memory controller register (a u32 type).
>
> To improve code sanity, fix this warning by changing 'status_mask' to
> a u64 type, ensuring it matches the size of 'log' for bitwise operations.
>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/aAih0KmEVq7ch6v2@stanley.mountain/
> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx>
Applied. Thanks.
-Tony