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

From: Manish Baing

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


Use empty brace initialization (={}) instead of explicit memset()
to zero-initialize stack memory to simplify the code.

No functional change.

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

diff --git a/drivers/hwmon/ltc2947-core.c b/drivers/hwmon/ltc2947-core.c
index ad7120d1e469..d95265986b18 100644
--- a/drivers/hwmon/ltc2947-core.c
+++ b/drivers/hwmon/ltc2947-core.c
@@ -273,11 +273,9 @@ static int ltc2947_alarm_read(struct ltc2947_data *st, const u8 reg,
{
u8 offset = reg - LTC2947_REG_STATUS;
/* +1 to include status reg */
- char alarms[LTC2947_ALERTS_SIZE + 1];
+ char alarms[LTC2947_ALERTS_SIZE + 1] = { };
int ret = 0;

- memset(alarms, 0, sizeof(alarms));
-
ret = regmap_write(st->map, LTC2947_REG_PAGE_CTRL, LTC2947_PAGE0);
if (ret)
return ret;
--
2.43.0