Skip to contentSkip to conversation

2..6.0-bk6 /drivers/acpi/* ACPI printf fixes - save 1.3KB

PATCH New Joe Perches 1 participant 1 message Sep 29, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2..6.0-bk6 /drivers/acpi/* ACPI printf fixes - save 1.3KB

Change formats strings to use less code&data space & apms->amps typo fix

drivers/acpi/ac.c +3 -12
diff -urN a/drivers/acpi/ac.c b/drivers/acpi/ac.c
@@ -124,18 +124,9 @@
 		return 0;
 	}
 
-	seq_puts(seq, "state:                   ");
-	switch (ac->state) {
-	case ACPI_AC_STATUS_OFFLINE:
-		seq_puts(seq, "off-line\n");
-		break;
-	case ACPI_AC_STATUS_ONLINE:
-		seq_puts(seq, "on-line\n");
-		break;
-	default:
-		seq_puts(seq, "unknown\n");
-		break;
-	}
+	seq_printf(seq,"%-25s%s\n","state:",
+		   ac->state==ACPI_AC_STATUS_OFFLINE ? "off-line" :
+		   ac->state==ACPI_AC_STATUS_ONLINE ? "on-line" : "unknown");
 
 	return 0;
 }
drivers/acpi/battery.c +52 -49

213 lines not on this page · raw message

drivers/acpi/thermal.c +10 -10
diff -urN a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
@@ -776,7 +776,7 @@
 	if (!tz)
 		goto end;
 
-	seq_puts(seq, "state:                   ");
+	seq_printf(seq, "%-25s", "state:");
 
 	if (!tz->state.critical && !tz->state.hot && !tz->state.passive && !tz->state.active)
 		seq_puts(seq, "ok\n");
@@ -816,7 +816,7 @@
 	if (result)
 		goto end;
 
-	seq_printf(seq, "temperature:             %ld C\n", 
+	seq_printf(seq, "%-25s%ld C\n","temperature:", 
 		KELVIN_TO_CELSIUS(tz->temperature));
 
 end:
@@ -841,21 +841,21 @@
 		goto end;
 
 	if (tz->trips.critical.flags.valid)
-		seq_printf(seq, "critical (S5):           %ld C\n",
+		seq_printf(seq, "%-25s%ld C\n", "critical (S5):",
 			KELVIN_TO_CELSIUS(tz->trips.critical.temperature));
 
 	if (tz->trips.hot.flags.valid)
-		seq_printf(seq, "hot (S4):                %ld C\n",
+		seq_printf(seq, "%-25s%ld C\n", "hot (S4):",
 			KELVIN_TO_CELSIUS(tz->trips.hot.temperature));
 
 	if (tz->trips.passive.flags.valid) {
-		seq_printf(seq, "passive:                 %ld C: tc1=%lu tc2=%lu tsp=%lu devices=",
+		seq_printf(seq, "%-25s%ld C: tc1=%lu tc2=%lu tsp=%lu", "passive:",
 			KELVIN_TO_CELSIUS(tz->trips.passive.temperature),
 			tz->trips.passive.tc1,
 			tz->trips.passive.tc2, 
 			tz->trips.passive.tsp);
+		seq_puts(seq, " devices=");
 		for (j=0; j<tz->trips.passive.devices.count; j++) {
-
 			seq_printf(seq, "0x%p ", tz->trips.passive.devices.handles[j]);
 		}
 		seq_puts(seq, "\n");
@@ -864,8 +864,9 @@
 	for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
 		if (!(tz->trips.active[i].flags.valid))
 			break;
-		seq_printf(seq, "active[%d]:               %ld C: devices=",
+		seq_printf(seq, "active[%d]:               %ld C:",
 			i, KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
+		seq_puts(seq, " devices=");
 		for (j = 0; j < tz->trips.active[i].devices.count; j++) 
 			seq_printf(seq, "0x%p ",
 				tz->trips.active[i].devices.handles[j]);
@@ -937,8 +938,7 @@
 		goto end;
 	}
 
-	seq_printf(seq, "cooling mode:            %s\n",
-		tz->cooling_mode?"passive":"active");
+	seq_printf(seq, "%-25s%s\n", "cooling mode:", tz->cooling_mode ? "passive" : "active");
 
 end:
 	return 0;
@@ -998,7 +998,7 @@
 		goto end;
 	}
 
-	seq_printf(seq, "polling frequency:       %lu seconds\n",
+	seq_printf(seq, "%-25s%lu seconds\n", "polling frequency:",
 		(tz->polling_frequency / 10));
 
 end: