Cleanup macro abuse in battery.c

From: Pavel Machek
Date: Wed Sep 15 2004 - 06:18:50 EST


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!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/