public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* acpi: remove obfuscating macro from acpi/battery.c
@ 2005-03-19 11:03 Pavel Machek
  0 siblings, 0 replies; only message in thread
From: Pavel Machek @ 2005-03-19 11:03 UTC (permalink / raw)
  To: ACPI mailing list, Len Brown

Hi!

It seems to me that macros in battery.c only make code more obscure
and longer. This fixes it a bit. Please apply,
								Pavel

--- clean/drivers/acpi/battery.c	2004-12-25 13:34:58.000000000 +0100
+++ linux/drivers/acpi/battery.c	2004-12-25 16:31:14.000000000 +0100
@@ -50,8 +50,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
@@ -369,7 +374,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)
 		seq_printf(seq, "design capacity:         unknown\n");
@@ -452,7 +457,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) */
 
@@ -528,7 +533,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!


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

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

only message in thread, other threads:[~2005-03-19 11:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-19 11:03 acpi: remove obfuscating macro from acpi/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