From: Andrey Vatoropin a.vatoropin@crpt.ru
Add suffix ULL to constant 500 in order to give the compiler complete information about the proper arithmetic to use. Notice that this constant is used in a context that expects an expression of type u64 (64 bits, unsigned).
The expression PCC_NUM_RETRIES * cppc_ss->latency, which at preprocessing time translates to cppc_ss->latency; is currently being evaluated using 32-bit arithmetic.
This is similar to commit b52f45110502 ("ACPI / CPPC: Use 64-bit arithmetic instead of 32-bit")
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Vatoropin a.vatoropin@crpt.ru --- drivers/hwmon/xgene-hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c index 1e3bd129a922..43a08ddb964b 100644 --- a/drivers/hwmon/xgene-hwmon.c +++ b/drivers/hwmon/xgene-hwmon.c @@ -61,7 +61,7 @@ * Arbitrary retries in case the remote processor is slow to respond * to PCC commands */ -#define PCC_NUM_RETRIES 500 +#define PCC_NUM_RETRIES 500ULL
#define ASYNC_MSG_FIFO_SIZE 16 #define MBOX_OP_TIMEOUTMS 1000