[PATCH] hwmon: (hih6130) Replace sprintf() with sysfs_emit()

From: Massinissa Ghoul via B4 Relay

Date: Sun Sep 06 2026 - 18:39:58 EST


From: Massinissa Ghoul <massigh680@xxxxxxxxx>

Use sysfs_emit() instead of sprintf() in the sysfs show functions
hih6130_temperature_show() and hih6130_humidity_show() to use the
preferred kernel interface for writing to sysfs buffers.

No functional change intended.

Note: Not runtime tested due to lack of hardware.

Signed-off-by: Massinissa Ghoul <massigh680@xxxxxxxxx>
---
drivers/hwmon/hih6130.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/hih6130.c b/drivers/hwmon/hih6130.c
index 7984be1e706d..6a79aab5d128 100644
--- a/drivers/hwmon/hih6130.c
+++ b/drivers/hwmon/hih6130.c
@@ -168,7 +168,7 @@ static ssize_t hih6130_temperature_show(struct device *dev,
ret = hih6130_update_measurements(dev);
if (ret < 0)
return ret;
- return sprintf(buf, "%d\n", hih6130->temperature);
+ return sysfs_emit(buf, "%d\n", hih6130->temperature);
}

/**
@@ -189,7 +189,7 @@ static ssize_t hih6130_humidity_show(struct device *dev,
ret = hih6130_update_measurements(dev);
if (ret < 0)
return ret;
- return sprintf(buf, "%d\n", hih6130->humidity);
+ return sysfs_emit(buf, "%d\n", hih6130->humidity);
}

/* sysfs attributes */

---
base-commit: ba08432bda66a7889d8f3d1581dabf10f59b25eb
change-id: 20260907-hwmon-hih6130-sysfs-emit-075116223077

Best regards,
--
Massinissa Ghoul <massigh680@xxxxxxxxx>