aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2005-11-29 03:43:42 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 16:51:40 -0500
commit4c4c9432a6c916729c7296c47fe93b053a73e20c (patch)
tree7f02f456359259da8bae5e3d32fc4411311ee135 /drivers/usb/input
parent9fe6fcd8ccb2c8c661dfd1e07e3122aef31a67d4 (diff)
[PATCH] USB: mark various usb tables const
patch below marks various USB tables and variables as const so that they end up in .rodata section and don't cacheline share with things that get written to. For the non-array variables it also allows gcc to optimize more. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/input')
-rw-r--r--drivers/usb/input/aiptek.c2
-rw-r--r--drivers/usb/input/ati_remote.c4
-rw-r--r--drivers/usb/input/fixp-arith.h2
-rw-r--r--drivers/usb/input/hid-core.c2
-rw-r--r--drivers/usb/input/hid-input.c4
-rw-r--r--drivers/usb/input/keyspan_remote.c2
-rw-r--r--drivers/usb/input/xpad.c6
7 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
index 356284c746a0..87ae08c99bc4 100644
--- a/drivers/usb/input/aiptek.c
+++ b/drivers/usb/input/aiptek.c
@@ -338,7 +338,7 @@ struct aiptek {
338 * the bitmap which comes from the tablet. This hides the 338 * the bitmap which comes from the tablet. This hides the
339 * issue that the F_keys are not sequentially numbered. 339 * issue that the F_keys are not sequentially numbered.
340 */ 340 */
341static int macroKeyEvents[] = { 341static const int macroKeyEvents[] = {
342 KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, 342 KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
343 KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, 343 KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11,
344 KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17, 344 KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17,
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c
index 8948e5c3941f..b78a4d81b0a3 100644
--- a/drivers/usb/input/ati_remote.c
+++ b/drivers/usb/input/ati_remote.c
@@ -146,7 +146,7 @@ static char init1[] = { 0x01, 0x00, 0x20, 0x14 };
146static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 }; 146static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };
147 147
148/* Acceleration curve for directional control pad */ 148/* Acceleration curve for directional control pad */
149static char accel[] = { 1, 2, 4, 6, 9, 13, 20 }; 149static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
150 150
151/* Duplicate event filtering time. 151/* Duplicate event filtering time.
152 * Sequential, identical KIND_FILTERED inputs with less than 152 * Sequential, identical KIND_FILTERED inputs with less than
@@ -197,7 +197,7 @@ struct ati_remote {
197#define KIND_ACCEL 7 /* Directional keypad - left, right, up, down.*/ 197#define KIND_ACCEL 7 /* Directional keypad - left, right, up, down.*/
198 198
199/* Translation table from hardware messages to input events. */ 199/* Translation table from hardware messages to input events. */
200static struct { 200static const struct {
201 short kind; 201 short kind;
202 unsigned char data1, data2; 202 unsigned char data1, data2;
203 int type; 203 int type;
diff --git a/drivers/usb/input/fixp-arith.h b/drivers/usb/input/fixp-arith.h
index 26ca5b890a61..b44d398de071 100644
--- a/drivers/usb/input/fixp-arith.h
+++ b/drivers/usb/input/fixp-arith.h
@@ -38,7 +38,7 @@ typedef s16 fixp_t;
38#define FRAC_MASK ((1<<FRAC_N)-1) 38#define FRAC_MASK ((1<<FRAC_N)-1)
39 39
40// Not to be used directly. Use fixp_{cos,sin} 40// Not to be used directly. Use fixp_{cos,sin}
41static fixp_t cos_table[45] = { 41static const fixp_t cos_table[45] = {
42 0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8, 42 0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8,
43 0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD, 43 0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD,
44 0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1, 44 0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1,
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 256d7325d4a5..5f52979af1c7 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1454,7 +1454,7 @@ void hid_init_reports(struct hid_device *hid)
1454 * Alphabetically sorted blacklist by quirk type. 1454 * Alphabetically sorted blacklist by quirk type.
1455 */ 1455 */
1456 1456
1457static struct hid_blacklist { 1457static const struct hid_blacklist {
1458 __u16 idVendor; 1458 __u16 idVendor;
1459 __u16 idProduct; 1459 __u16 idProduct;
1460 unsigned quirks; 1460 unsigned quirks;
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
index 1220a5004a5c..192a03b28971 100644
--- a/drivers/usb/input/hid-input.c
+++ b/drivers/usb/input/hid-input.c
@@ -39,7 +39,7 @@
39 39
40#define unk KEY_UNKNOWN 40#define unk KEY_UNKNOWN
41 41
42static unsigned char hid_keyboard[256] = { 42static const unsigned char hid_keyboard[256] = {
43 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 43 0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
44 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3, 44 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3,
45 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26, 45 4, 5, 6, 7, 8, 9, 10, 11, 28, 1, 14, 15, 57, 12, 13, 26,
@@ -58,7 +58,7 @@ static unsigned char hid_keyboard[256] = {
58 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk 58 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk
59}; 59};
60 60
61static struct { 61static const struct {
62 __s32 x; 62 __s32 x;
63 __s32 y; 63 __s32 y;
64} hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}}; 64} hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c
index 5ae5201dbf5a..b4a051b549d1 100644
--- a/drivers/usb/input/keyspan_remote.c
+++ b/drivers/usb/input/keyspan_remote.c
@@ -95,7 +95,7 @@ struct usb_keyspan {
95 * Currently there are 15 and 17 button models so RESERVED codes 95 * Currently there are 15 and 17 button models so RESERVED codes
96 * are blank areas in the mapping. 96 * are blank areas in the mapping.
97 */ 97 */
98static int keyspan_key_table[] = { 98static const int keyspan_key_table[] = {
99 KEY_RESERVED, /* 0 is just a place holder. */ 99 KEY_RESERVED, /* 0 is just a place holder. */
100 KEY_RESERVED, 100 KEY_RESERVED,
101 KEY_STOP, 101 KEY_STOP,
diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c
index e421328615fb..e278489a80c6 100644
--- a/drivers/usb/input/xpad.c
+++ b/drivers/usb/input/xpad.c
@@ -70,7 +70,7 @@
70 70
71#define XPAD_PKT_LEN 32 71#define XPAD_PKT_LEN 32
72 72
73static struct xpad_device { 73static const struct xpad_device {
74 u16 idVendor; 74 u16 idVendor;
75 u16 idProduct; 75 u16 idProduct;
76 char *name; 76 char *name;
@@ -81,13 +81,13 @@ static struct xpad_device {
81 { 0x0000, 0x0000, "X-Box pad" } 81 { 0x0000, 0x0000, "X-Box pad" }
82}; 82};
83 83
84static signed short xpad_btn[] = { 84static const signed short xpad_btn[] = {
85 BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, /* "analog" buttons */ 85 BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, /* "analog" buttons */
86 BTN_START, BTN_BACK, BTN_THUMBL, BTN_THUMBR, /* start/back/sticks */ 86 BTN_START, BTN_BACK, BTN_THUMBL, BTN_THUMBR, /* start/back/sticks */
87 -1 /* terminating entry */ 87 -1 /* terminating entry */
88}; 88};
89 89
90static signed short xpad_abs[] = { 90static const signed short xpad_abs[] = {
91 ABS_X, ABS_Y, /* left stick */ 91 ABS_X, ABS_Y, /* left stick */
92 ABS_RX, ABS_RY, /* right stick */ 92 ABS_RX, ABS_RY, /* right stick */
93 ABS_Z, ABS_RZ, /* triggers left/right */ 93 ABS_Z, ABS_RZ, /* triggers left/right */