[PATCH] - drivers/hid/hid-debug.c - trivial - add KERN_DEBUG prefix, fix typo, constify

Previous thread: queued patches for SCSI for 2.6.24 by James Bottomley on Tuesday, September 25, 2007 - 9:00 pm. (17 messages)

Next thread: NMI error and Intel S5000PSL Motherboards by AndrewL733 on Wednesday, September 26, 2007 - 6:12 am. (9 messages)
To: Jiri Kosina <jkosina@...>
Cc: <linux-input@...>, <linux-kernel@...>
Date: Tuesday, September 25, 2007 - 9:44 pm

Added KERN_DEBUG to output lines
Fixed preffered -> preferred typo
Added const to char *'s

Also, exported symbol hid_resolv_event is unused by the current
kernel tree and perhaps should be removed.

Signed-off-by: Joe Perches <joe@perches.com>

diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index a13757b..7754530 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -34,7 +34,7 @@
struct hid_usage_entry {
unsigned page;
unsigned usage;
- char *description;
+ const char *description;
};

static const struct hid_usage_entry hid_usage_table[] = {
@@ -365,8 +365,8 @@ void hid_resolv_usage(unsigned usage) {
}
EXPORT_SYMBOL_GPL(hid_resolv_usage);

-__inline__ static void tab(int n) {
- while (n--) printk(" ");
+static void tab(int n) {
+ printk(KERN_DEBUG "%*s", n, "");
}

void hid_dump_field(struct hid_field *field, int n) {
@@ -401,8 +401,8 @@ void hid_dump_field(struct hid_field *field, int n) {
tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent);
}
if (field->unit) {
- char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" };
- char *units[5][8] = {
+ static const char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" };
+ static const char *units[5][8] = {
{ "None", "None", "None", "None", "None", "None", "None", "None" },
{ "None", "Centimeter", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" },
{ "None", "Radians", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" },
@@ -457,7 +457,7 @@ void hid_dump_field(struct hid_field *field, int n) {
printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute ");
printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : "");
printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : "");
- printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPrefferedState " : "");
+ printk("%s", HID_MAIN_ITEM_NO_PREFERRED &...

To: Joe Perches <joe@...>
Cc: <linux-input@...>, <linux-kernel@...>
Date: Wednesday, September 26, 2007 - 11:10 am

This is not true, hid_resolv_event() is called from the code that
establishes the mapping between HID and input, see
hidinput_configure_usage().

Anyway, I applied your cleanup patch, thanks.

--
Jiri Kosina
SUSE Labs
-

Previous thread: queued patches for SCSI for 2.6.24 by James Bottomley on Tuesday, September 25, 2007 - 9:00 pm. (17 messages)

Next thread: NMI error and Intel S5000PSL Motherboards by AndrewL733 on Wednesday, September 26, 2007 - 6:12 am. (9 messages)