From: Pavel Machek <pavel@ucw.cz>
To: kernel list <linux-kernel@vger.kernel.org>,
ACPI mailing list <acpi-devel@lists.sourceforge.net>,
Len Brown <len.brown@intel.com>
Cc: Rusty trivial patch monkey Russell <trivial@rustcorp.com.au>
Subject: Cleanup macro abuse in battery.c
Date: Wed, 15 Sep 2004 13:16:46 +0200 [thread overview]
Message-ID: <20040915111646.GA19675@elf.ucw.cz> (raw)
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!
reply other threads:[~2004-09-15 11:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040915111646.GA19675@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=acpi-devel@lists.sourceforge.net \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=trivial@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox