Skip to contentSkip to conversation

thermal: debugfs: Use seq_puts() for constant string output

PATCH Applied Sumeet Pawnikar 2 participants 2 messages Jan 10 – Jan 15 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: debugfs: Use seq_puts() for constant string output

Replace seq_printf() with seq_puts() when outputting a constant string without format specifiers in the thermal mitigation debugfs interface. seq_puts() is more appropriate and efficient as it avoids unnecessary format string parsing overhead.

No functional change.

---
 drivers/thermal/thermal_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_debugfs.c +1 -1
index 11d34f2a3d9f..11668f5b3c28 100644
@@ -807,7 +807,7 @@ static int tze_seq_show(struct seq_file *s, void *v)
 	seq_printf(s, ",-Mitigation at %llums, duration%c%llums, max. temp=%dm°C\n",
 		   ktime_to_ms(tze->timestamp), c, duration_ms, tze->max_temp);
 
-	seq_printf(s, "| trip |     type | temp(m°C) | hyst(m°C) | duration(ms) |  avg(m°C) |  min(m°C) |\n");
+	seq_puts(s, "| trip |     type | temp(m°C) | hyst(m°C) | duration(ms) |  avg(m°C) |  min(m°C) |\n");
 
 	for_each_trip_desc(tz, td) {
 		const struct thermal_trip *trip = &td->trip;
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 18 lines · Sumeet Pawnikar

Replace seq_printf() with seq_puts() when outputting a constant string without format specifiers in the thermal mitigation debugfs interface. seq_puts() is more appropriate and efficient as it avoids unnecessary format string parsing overhead.

No functional change.

---
 drivers/thermal/thermal_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_debugfs.c +0 -0
index 11d34f2a3d9f..11668f5b3c28 100644

drivers/thermal/thermal_debugfs.c static int tze_seq_show(struct seq_file *s, void *v)

Quoted 9 lines
drivers/thermal/thermal_debugfs.c +1 -2
@@ -807,7 +807,7 @@ static int tze_seq_show(struct seq_file *s, void *v)
        seq_printf(s, ",-Mitigation at %llums, duration%c%llums, max. temp=%dm°C\n",
                   ktime_to_ms(tze->timestamp), c, duration_ms, tze->max_temp);
 
-       seq_printf(s, "| trip |     type | temp(m°C) | hyst(m°C) | duration(ms) |  avg(m°C) |  min(m°C) |\n");
+       seq_puts(s, "| trip |     type | temp(m°C) | hyst(m°C) | duration(ms) |  avg(m°C) |  min(m°C) |\n");
 
        for_each_trip_desc(tz, td) {
                const struct thermal_trip *trip = &td->trip;
--

Applied as 6.20 material, thanks!