public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Cleanup macro abuse in battery.c
@ 2004-09-15 11:16 Pavel Machek
  0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2004-09-15 11:16 UTC (permalink / raw)
  To: kernel list, ACPI mailing list, Len Brown
  Cc: Rusty trivial patch monkey Russell

Hi!

ACPI likes to abuse #define's quite a lot. This kills one of worst
offenders. Please apply,
								Pavel

--- clean-mm/drivers/acpi/battery.c	2004-08-24 09:03:30.000000000 +0200
+++ linux-mm/drivers/acpi/battery.c	2004-09-15 13:00:50.000000000 +0200
@@ -49,8 +49,6 @@
 #define ACPI_BATTERY_FILE_ALARM		"alarm"
 #define ACPI_BATTERY_NOTIFY_STATUS	0x80
 #define ACPI_BATTERY_NOTIFY_INFO	0x81
-#define ACPI_BATTERY_UNITS_WATTS	"mW"
-#define ACPI_BATTERY_UNITS_AMPS		"mA"
 
 
 #define _COMPONENT		ACPI_BATTERY_COMPONENT
@@ -378,7 +376,7 @@
 		goto end;
 	}
 
-	units = bif->power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+	units = bif->power_unit ? "mA" : "mW";
 					
 	if (bif->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
 		p += sprintf(p, "design capacity:         unknown\n");
@@ -471,7 +469,7 @@
 
 	/* Battery Units */
 
-	units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+	units = battery->flags.power_unit ? "mA" : "mW";
 
 	/* Battery Status (_BST) */
 
@@ -557,7 +555,7 @@
 
 	/* Battery Units */
 	
-	units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+	units = battery->flags.power_unit ? "mA" : "mW";
 
 	/* Battery Alarm */
 

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-15 11:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 11:16 Cleanup macro abuse in battery.c Pavel Machek

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