diff options
| author | Joe Perches <joe@perches.com> | 2007-09-26 10:29:53 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2007-10-14 07:40:01 -0400 |
| commit | 0ce1ac3b3ca0f44682aed210ba6062bafc2e32fa (patch) | |
| tree | 56f2655e61080866209f41055440640a7d1c0051 | |
| parent | f14d5d206cf84357a7072ddb2bbc7d3454639f11 (diff) | |
HID: trivial fixes in hid-debug
- 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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| -rw-r--r-- | drivers/hid/hid-debug.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 27e4cf003834..5da9f676b4cf 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | struct hid_usage_entry { | 34 | struct hid_usage_entry { |
| 35 | unsigned page; | 35 | unsigned page; |
| 36 | unsigned usage; | 36 | unsigned usage; |
| 37 | char *description; | 37 | const char *description; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | static const struct hid_usage_entry hid_usage_table[] = { | 40 | static const struct hid_usage_entry hid_usage_table[] = { |
| @@ -365,8 +365,8 @@ void hid_resolv_usage(unsigned usage) { | |||
| 365 | } | 365 | } |
| 366 | EXPORT_SYMBOL_GPL(hid_resolv_usage); | 366 | EXPORT_SYMBOL_GPL(hid_resolv_usage); |
| 367 | 367 | ||
| 368 | __inline__ static void tab(int n) { | 368 | static void tab(int n) { |
| 369 | while (n--) printk(" "); | 369 | printk(KERN_DEBUG "%*s", n, ""); |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | void hid_dump_field(struct hid_field *field, int n) { | 372 | void hid_dump_field(struct hid_field *field, int n) { |
| @@ -401,8 +401,8 @@ void hid_dump_field(struct hid_field *field, int n) { | |||
| 401 | tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent); | 401 | tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent); |
| 402 | } | 402 | } |
| 403 | if (field->unit) { | 403 | if (field->unit) { |
| 404 | char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" }; | 404 | static const char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" }; |
| 405 | char *units[5][8] = { | 405 | static const char *units[5][8] = { |
| 406 | { "None", "None", "None", "None", "None", "None", "None", "None" }, | 406 | { "None", "None", "None", "None", "None", "None", "None", "None" }, |
| 407 | { "None", "Centimeter", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, | 407 | { "None", "Centimeter", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, |
| 408 | { "None", "Radians", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, | 408 | { "None", "Radians", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" }, |
| @@ -457,7 +457,7 @@ void hid_dump_field(struct hid_field *field, int n) { | |||
| 457 | printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute "); | 457 | printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute "); |
| 458 | printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : ""); | 458 | printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : ""); |
| 459 | printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : ""); | 459 | printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : ""); |
| 460 | printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPrefferedState " : ""); | 460 | printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPreferredState " : ""); |
| 461 | printk("%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : ""); | 461 | printk("%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : ""); |
| 462 | printk("%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : ""); | 462 | printk("%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : ""); |
| 463 | printk("%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : ""); | 463 | printk("%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : ""); |
| @@ -470,7 +470,7 @@ void hid_dump_device(struct hid_device *device) { | |||
| 470 | struct hid_report *report; | 470 | struct hid_report *report; |
| 471 | struct list_head *list; | 471 | struct list_head *list; |
| 472 | unsigned i,k; | 472 | unsigned i,k; |
| 473 | static char *table[] = {"INPUT", "OUTPUT", "FEATURE"}; | 473 | static const char *table[] = {"INPUT", "OUTPUT", "FEATURE"}; |
| 474 | 474 | ||
| 475 | if (!hid_debug) | 475 | if (!hid_debug) |
| 476 | return; | 476 | return; |
| @@ -501,13 +501,13 @@ void hid_dump_input(struct hid_usage *usage, __s32 value) { | |||
| 501 | if (!hid_debug) | 501 | if (!hid_debug) |
| 502 | return; | 502 | return; |
| 503 | 503 | ||
| 504 | printk("hid-debug: input "); | 504 | printk(KERN_DEBUG "hid-debug: input "); |
| 505 | hid_resolv_usage(usage->hid); | 505 | hid_resolv_usage(usage->hid); |
| 506 | printk(" = %d\n", value); | 506 | printk(" = %d\n", value); |
| 507 | } | 507 | } |
| 508 | EXPORT_SYMBOL_GPL(hid_dump_input); | 508 | EXPORT_SYMBOL_GPL(hid_dump_input); |
| 509 | 509 | ||
| 510 | static char *events[EV_MAX + 1] = { | 510 | static const char *events[EV_MAX + 1] = { |
| 511 | [EV_SYN] = "Sync", [EV_KEY] = "Key", | 511 | [EV_SYN] = "Sync", [EV_KEY] = "Key", |
| 512 | [EV_REL] = "Relative", [EV_ABS] = "Absolute", | 512 | [EV_REL] = "Relative", [EV_ABS] = "Absolute", |
| 513 | [EV_MSC] = "Misc", [EV_LED] = "LED", | 513 | [EV_MSC] = "Misc", [EV_LED] = "LED", |
| @@ -516,10 +516,10 @@ static char *events[EV_MAX + 1] = { | |||
| 516 | [EV_FF_STATUS] = "ForceFeedbackStatus", | 516 | [EV_FF_STATUS] = "ForceFeedbackStatus", |
| 517 | }; | 517 | }; |
| 518 | 518 | ||
| 519 | static char *syncs[2] = { | 519 | static const char *syncs[2] = { |
| 520 | [SYN_REPORT] = "Report", [SYN_CONFIG] = "Config", | 520 | [SYN_REPORT] = "Report", [SYN_CONFIG] = "Config", |
| 521 | }; | 521 | }; |
| 522 | static char *keys[KEY_MAX + 1] = { | 522 | static const char *keys[KEY_MAX + 1] = { |
| 523 | [KEY_RESERVED] = "Reserved", [KEY_ESC] = "Esc", | 523 | [KEY_RESERVED] = "Reserved", [KEY_ESC] = "Esc", |
| 524 | [KEY_1] = "1", [KEY_2] = "2", | 524 | [KEY_1] = "1", [KEY_2] = "2", |
| 525 | [KEY_3] = "3", [KEY_4] = "4", | 525 | [KEY_3] = "3", [KEY_4] = "4", |
| @@ -715,7 +715,7 @@ static char *keys[KEY_MAX + 1] = { | |||
| 715 | [KEY_SWITCHVIDEOMODE] = "SwitchVideoMode", | 715 | [KEY_SWITCHVIDEOMODE] = "SwitchVideoMode", |
| 716 | }; | 716 | }; |
| 717 | 717 | ||
| 718 | static char *relatives[REL_MAX + 1] = { | 718 | static const char *relatives[REL_MAX + 1] = { |
| 719 | [REL_X] = "X", [REL_Y] = "Y", | 719 | [REL_X] = "X", [REL_Y] = "Y", |
| 720 | [REL_Z] = "Z", [REL_RX] = "Rx", | 720 | [REL_Z] = "Z", [REL_RX] = "Rx", |
| 721 | [REL_RY] = "Ry", [REL_RZ] = "Rz", | 721 | [REL_RY] = "Ry", [REL_RZ] = "Rz", |
| @@ -723,7 +723,7 @@ static char *relatives[REL_MAX + 1] = { | |||
| 723 | [REL_WHEEL] = "Wheel", [REL_MISC] = "Misc", | 723 | [REL_WHEEL] = "Wheel", [REL_MISC] = "Misc", |
| 724 | }; | 724 | }; |
| 725 | 725 | ||
| 726 | static char *absolutes[ABS_MAX + 1] = { | 726 | static const char *absolutes[ABS_MAX + 1] = { |
| 727 | [ABS_X] = "X", [ABS_Y] = "Y", | 727 | [ABS_X] = "X", [ABS_Y] = "Y", |
| 728 | [ABS_Z] = "Z", [ABS_RX] = "Rx", | 728 | [ABS_Z] = "Z", [ABS_RX] = "Rx", |
| 729 | [ABS_RY] = "Ry", [ABS_RZ] = "Rz", | 729 | [ABS_RY] = "Ry", [ABS_RZ] = "Rz", |
| @@ -739,12 +739,12 @@ static char *absolutes[ABS_MAX + 1] = { | |||
| 739 | [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc", | 739 | [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc", |
| 740 | }; | 740 | }; |
| 741 | 741 | ||
| 742 | static char *misc[MSC_MAX + 1] = { | 742 | static const char *misc[MSC_MAX + 1] = { |
| 743 | [MSC_SERIAL] = "Serial", [MSC_PULSELED] = "Pulseled", | 743 | [MSC_SERIAL] = "Serial", [MSC_PULSELED] = "Pulseled", |
| 744 | [MSC_GESTURE] = "Gesture", [MSC_RAW] = "RawData" | 744 | [MSC_GESTURE] = "Gesture", [MSC_RAW] = "RawData" |
| 745 | }; | 745 | }; |
| 746 | 746 | ||
| 747 | static char *leds[LED_MAX + 1] = { | 747 | static const char *leds[LED_MAX + 1] = { |
| 748 | [LED_NUML] = "NumLock", [LED_CAPSL] = "CapsLock", | 748 | [LED_NUML] = "NumLock", [LED_CAPSL] = "CapsLock", |
| 749 | [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose", | 749 | [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose", |
| 750 | [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep", | 750 | [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep", |
| @@ -752,16 +752,16 @@ static char *leds[LED_MAX + 1] = { | |||
| 752 | [LED_MISC] = "Misc", | 752 | [LED_MISC] = "Misc", |
| 753 | }; | 753 | }; |
| 754 | 754 | ||
| 755 | static char *repeats[REP_MAX + 1] = { | 755 | static const char *repeats[REP_MAX + 1] = { |
| 756 | [REP_DELAY] = "Delay", [REP_PERIOD] = "Period" | 756 | [REP_DELAY] = "Delay", [REP_PERIOD] = "Period" |
| 757 | }; | 757 | }; |
| 758 | 758 | ||
| 759 | static char *sounds[SND_MAX + 1] = { | 759 | static const char *sounds[SND_MAX + 1] = { |
| 760 | [SND_CLICK] = "Click", [SND_BELL] = "Bell", | 760 | [SND_CLICK] = "Click", [SND_BELL] = "Bell", |
| 761 | [SND_TONE] = "Tone" | 761 | [SND_TONE] = "Tone" |
| 762 | }; | 762 | }; |
| 763 | 763 | ||
| 764 | static char **names[EV_MAX + 1] = { | 764 | static const char **names[EV_MAX + 1] = { |
| 765 | [EV_SYN] = syncs, [EV_KEY] = keys, | 765 | [EV_SYN] = syncs, [EV_KEY] = keys, |
| 766 | [EV_REL] = relatives, [EV_ABS] = absolutes, | 766 | [EV_REL] = relatives, [EV_ABS] = absolutes, |
| 767 | [EV_MSC] = misc, [EV_LED] = leds, | 767 | [EV_MSC] = misc, [EV_LED] = leds, |
| @@ -777,4 +777,3 @@ void hid_resolv_event(__u8 type, __u16 code) { | |||
| 777 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); | 777 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); |
| 778 | } | 778 | } |
| 779 | EXPORT_SYMBOL_GPL(hid_resolv_event); | 779 | EXPORT_SYMBOL_GPL(hid_resolv_event); |
| 780 | |||
