From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: dtor@insightbb.com, pavel@ucw.cz, lenb@kernel.org,
linux-input@atrey.karlin.mff.cuni.cz,
linux-kernel@vger.kernel.org
Subject: [PATCH] apanel: space savings.
Date: Thu, 25 Oct 2007 13:19:06 -0700 [thread overview]
Message-ID: <20071025131906.36847ed7@shemminger-laptop> (raw)
In-Reply-To: <20071024160300.85e1cbda.akpm@linux-foundation.org>
Eliminate the device_names they are only used for debug
messages. Add paren's for one expression.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/input/misc/apanel.c 2007-10-25 09:20:23.000000000 -0700
+++ b/drivers/input/misc/apanel.c 2007-10-25 12:07:00.000000000 -0700
@@ -27,7 +27,7 @@
#include <linux/leds.h>
#define APANEL_NAME "Fujitsu Application Panel"
-#define APANEL_VERSION "1.3"
+#define APANEL_VERSION "1.3.1"
#define APANEL "apanel"
/* How often we poll keys - msecs */
@@ -40,6 +40,7 @@ enum apanel_devid {
APANEL_DEV_CDBTN = 2,
APANEL_DEV_LCD = 3,
APANEL_DEV_LED = 4,
+
APANEL_DEV_MAX,
};
@@ -53,14 +54,6 @@ enum apanel_chip {
/* Result of BIOS snooping/probing -- what features are supported */
static enum apanel_chip device_chip[APANEL_DEV_MAX];
-/* names for APANEL_XXX */
-static const char *device_names[APANEL_DEV_MAX] __initdata = {
- [APANEL_DEV_APPBTN] = "Application Buttons",
- [APANEL_DEV_LCD] = "LCD",
- [APANEL_DEV_LED] = "LED",
- [APANEL_DEV_CDBTN] = "CD Buttons",
-};
-
#define MAX_PANEL_KEYS 12
struct apanel {
@@ -123,7 +116,7 @@ static void apanel_poll(struct input_pol
dev_dbg(&ipdev->input->dev, APANEL ": data %#x\n", data);
for (i = 0; i < ipdev->input->keycodemax; i++)
- if (1ul << i & data)
+ if ((1u << i) & data)
report_key(idev, ap->keymap[i]);
}
@@ -366,17 +359,14 @@ static int __init apanel_init(void)
}
if (devno >= APANEL_DEV_MAX)
- pr_notice(APANEL ": unknown device %d found\n", devno);
+ pr_notice(APANEL ": unknown device %u found\n", devno);
else if (device_chip[devno] != CHIP_NONE)
- pr_warning(APANEL ": duplicate entry for %s\n",
- device_names[devno]);
+ pr_warning(APANEL ": duplicate entry for devno %u\n", devno);
else if (method != 1 && method != 2 && method != 4) {
- pr_notice(APANEL ": unknown method %u for %s\n",
- method, device_names[devno]);
+ pr_notice(APANEL ": unknown method %u for devno %u\n",
+ method, devno);
} else {
- pr_debug(APANEL ": %s found.\n", device_names[devno]);
-
device_chip[devno] = (enum apanel_chip) chip;
++found;
}
next prev parent reply other threads:[~2007-10-25 20:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-02 18:17 [PATCH] fujtisu application panel driver Stephen Hemminger
2007-07-02 19:16 ` Dmitry Torokhov
2007-09-03 8:58 ` Stephen Hemminger
2007-09-07 12:02 ` Pavel Machek
2007-09-12 11:38 ` [PATCH] Fujitsu application panel driver (rev3) Stephen Hemminger
2007-09-14 5:30 ` Dmitry Torokhov
2007-09-16 19:55 ` Stephen Hemminger
2007-09-16 20:22 ` Dmitry Torokhov
2007-10-23 19:55 ` [PATCH] Fujitsu application panel driver Stephen Hemminger
2007-10-24 23:03 ` Andrew Morton
2007-10-25 20:19 ` Stephen Hemminger [this message]
2007-10-28 5:30 ` Dmitry Torokhov
2007-11-18 22:36 ` Robert Gerlach
2007-11-19 4:43 ` Stephen Hemminger
2007-11-19 12:50 ` Robert Gerlach
2007-11-19 17:26 ` Stephen Hemminger
2007-11-19 20:37 ` Robert Gerlach
2007-11-19 23:19 ` Stephen Hemminger
2007-12-19 9:04 ` Robert Gerlach
2007-12-12 14:10 ` Dmitry Torokhov
2007-12-12 22:21 ` [PATCH] Fujitsu application panel led value Stephen Hemminger
2007-07-05 1:29 ` [PATCH] fujtisu application panel driver Jason Uhlenkott
2007-09-03 9:00 ` Stephen Hemminger
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=20071025131906.36847ed7@shemminger-laptop \
--to=shemminger@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=dtor@insightbb.com \
--cc=lenb@kernel.org \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
/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;
as well as URLs for NNTP newsgroup(s).