summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAndrey Vatoropin <a.vatoropin@crpt.ru>2025-02-04 09:54:08 +0000
committerGuenter Roeck <linux@roeck-us.net>2025-02-06 18:52:38 -0800
commit8df0f002827e18632dcd986f7546c1abf1953a6f (patch)
tree262b82ec0cd1b53386e5caf6bd3c3137d4f152e2 /drivers/hwmon
parent4f3cef561f6551a4fcf0ef100530fd9e4c255f43 (diff)
downloadlinux-next-8df0f002827e18632dcd986f7546c1abf1953a6f.tar.gz
linux-next-8df0f002827e18632dcd986f7546c1abf1953a6f.zip
hwmon: (xgene-hwmon) use appropriate type for the latency value
The expression PCC_NUM_RETRIES * pcc_chan->latency is currently being evaluated using 32-bit arithmetic. Since a value of type 'u64' is used to store the eventual result, and this result is later sent to the function usecs_to_jiffies with input parameter unsigned int, the current data type is too wide to store the value of ctx->usecs_lat. Change the data type of "usecs_lat" to a more suitable (narrower) type. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru> Link: https://lore.kernel.org/r/20250204095400.95013-1-a.vatoropin@crpt.ru Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/xgene-hwmon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
index 1e3bd129a922..eb67190d9a86 100644
--- a/drivers/hwmon/xgene-hwmon.c
+++ b/drivers/hwmon/xgene-hwmon.c
@@ -105,7 +105,7 @@ struct xgene_hwmon_dev {
phys_addr_t comm_base_addr;
void *pcc_comm_addr;
- u64 usecs_lat;
+ unsigned int usecs_lat;
};
/*