[PATCH 7/7] hwmon: it87: Use zero-initialization instead of memset()

From: Manish Baing

Date: Sat May 30 2026 - 18:14:59 EST


Reduce the scope of 'struct it87_sio_data sio_data' by moving it inside
the for-loop and using empty brace initialization (= {}). This ensures
the structure is safely zero-initialized on every iteration, allowing for
the safe removal of the explicit memset() call.

No functional change.

Signed-off-by: Manish Baing <manishbaing2789@xxxxxxxxx>
---
drivers/hwmon/it87.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 5fd310662ee4..f3f8d835ff92 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -3777,7 +3777,6 @@ MODULE_DEVICE_TABLE(dmi, it87_dmi_table);
static int __init sm_it87_init(void)
{
int sioaddr[2] = { REG_2E, REG_4E };
- struct it87_sio_data sio_data;
unsigned short isa_address[2];
bool found = false;
int i, err;
@@ -3789,7 +3788,7 @@ static int __init sm_it87_init(void)
dmi_check_system(it87_dmi_table);

for (i = 0; i < ARRAY_SIZE(sioaddr); i++) {
- memset(&sio_data, 0, sizeof(struct it87_sio_data));
+ struct it87_sio_data sio_data = { };
isa_address[i] = 0;
err = it87_find(sioaddr[i], &isa_address[i], &sio_data, i);
if (err || isa_address[i] == 0)
--
2.43.0