HwmonTempMain: revert the type of bus and address back to uint64_t
In I546e967abae7c0fb9fca645867e3037046037647, the type of bus and
address in HwmonTempMain were updated to size_t.
However, in some systems using i3c, the device name is composed by bus
number and the provisioned ID [1]. The provisioned ID is a 48-bit value
(MIPI I3C Basic, v1.1.1, section 5.1.4.1.1), which is greater than the
range of size_t on e.g. 32-bit ARM platforms. Thus, reverting the type
back to uint64_t.
[1] Linux in-turn uses this Provisioned ID to identify the device, and
exposes the Provisioned ID in the device name:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/i3c/master.c?h=v6.6#n1521
Tested:
- added unit test passed.
- can read temperature of the i3c devices from our system.
Change-Id: I6f0e73aaf5f8d28e4bdedbe85646373463f6707f
Signed-off-by: Tom Tung <shes050117@gmail.com>
diff --git a/src/HwmonTempMain.cpp b/src/HwmonTempMain.cpp
index b44eb9d..8531776 100644
--- a/src/HwmonTempMain.cpp
+++ b/src/HwmonTempMain.cpp
@@ -302,8 +302,8 @@
deviceName = fs::canonical(device).stem();
}
- size_t bus = 0;
- size_t addr = 0;
+ uint64_t bus = 0;
+ uint64_t addr = 0;
if (!getDeviceBusAddr(deviceName, bus, addr))
{
continue;