Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH] hwmon: (hih6130) Replace sprintf() with sysfs_emit()
@ 2026-09-06 22:35 Massinissa Ghoul via B4 Relay
  2026-09-06 22:43 ` sashiko-bot
  2026-09-08 16:14 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Massinissa Ghoul via B4 Relay @ 2026-09-06 22:35 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Massinissa Ghoul

From: Massinissa Ghoul <massigh680@gmail.com>

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@gmail.com>
---
 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@gmail.com>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-08 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 22:35 [PATCH] hwmon: (hih6130) Replace sprintf() with sysfs_emit() Massinissa Ghoul via B4 Relay
2026-09-06 22:43 ` sashiko-bot
2026-09-08 16:14 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox