Skip to contentSkip to conversation

acpi: remove obfuscating macro from acpi/battery.c

PATCH Pavel Machek 1 participant 1 message Mar 19, 2005 ACPI

lore
Share & tools
lore
#0 lore raw

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

drivers/acpi/battery.c +3 -5
@@ -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 */
 
Signature · 9 lines
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