[PATCH] apanel: space savings.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <dtor@...>, <pavel@...>, <lenb@...>, <linux-input@...>, <linux-kernel@...>
Date: Thursday, October 25, 2007 - 4:19 pm

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;
 		}
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] fujtisu application panel driver, Stephen Hemminger, (Mon Jul 2, 2:17 pm)
Re: [PATCH] fujtisu application panel driver, Jason Uhlenkott, (Wed Jul 4, 9:29 pm)
Re: [PATCH] fujtisu application panel driver, Stephen Hemminger, (Mon Sep 3, 5:00 am)
Re: [PATCH] fujtisu application panel driver, Dmitry Torokhov, (Mon Jul 2, 3:16 pm)
Re: [PATCH] fujtisu application panel driver, Stephen Hemminger, (Mon Sep 3, 4:58 am)
Re: [PATCH] fujtisu application panel driver, Pavel Machek, (Fri Sep 7, 8:02 am)
[PATCH] Fujitsu application panel driver (rev3), Stephen Hemminger, (Wed Sep 12, 7:38 am)
Re: [PATCH] Fujitsu application panel driver (rev3), Dmitry Torokhov, (Fri Sep 14, 1:30 am)
Re: [PATCH] Fujitsu application panel driver (rev3), Stephen Hemminger, (Sun Sep 16, 3:55 pm)
Re: [PATCH] Fujitsu application panel driver (rev3), Dmitry Torokhov, (Sun Sep 16, 4:22 pm)
[PATCH] Fujitsu application panel driver, Stephen Hemminger, (Tue Oct 23, 3:55 pm)
Re: [PATCH] Fujitsu application panel driver, Dmitry Torokhov, (Wed Dec 12, 10:10 am)
[PATCH] Fujitsu application panel led value, Stephen Hemminger, (Wed Dec 12, 6:21 pm)
Re: [PATCH] Fujitsu application panel driver, Robert Gerlach, (Sun Nov 18, 6:36 pm)
Re: [PATCH] Fujitsu application panel driver, Stephen Hemminger, (Mon Nov 19, 12:43 am)
Re: [PATCH] Fujitsu application panel driver, Robert Gerlach, (Mon Nov 19, 8:50 am)
Re: [PATCH] Fujitsu application panel driver, Stephen Hemminger, (Mon Nov 19, 7:19 pm)
Re: [PATCH] Fujitsu application panel driver, Robert Gerlach, (Wed Dec 19, 5:04 am)
Re: [PATCH] Fujitsu application panel driver, Stephen Hemminger, (Mon Nov 19, 1:26 pm)
Re: [PATCH] Fujitsu application panel driver, Robert Gerlach, (Mon Nov 19, 4:37 pm)
Re: [PATCH] Fujitsu application panel driver, Dmitry Torokhov, (Sun Oct 28, 1:30 am)
Re: [PATCH] Fujitsu application panel driver, Andrew Morton, (Wed Oct 24, 7:03 pm)
[PATCH] apanel: space savings., Stephen Hemminger, (Thu Oct 25, 4:19 pm)