[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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9fe6fcd8cc
commit
4c4c9432a6
@@ -338,7 +338,7 @@ struct aiptek {
|
||||
* the bitmap which comes from the tablet. This hides the
|
||||
* issue that the F_keys are not sequentially numbered.
|
||||
*/
|
||||
static int macroKeyEvents[] = {
|
||||
static const int macroKeyEvents[] = {
|
||||
KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
|
||||
KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11,
|
||||
KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17,
|
||||
|
@@ -146,7 +146,7 @@ static char init1[] = { 0x01, 0x00, 0x20, 0x14 };
|
||||
static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };
|
||||
|
||||
/* Acceleration curve for directional control pad */
|
||||
static char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
|
||||
static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
|
||||
|
||||
/* Duplicate event filtering time.
|
||||
* Sequential, identical KIND_FILTERED inputs with less than
|
||||
@@ -197,7 +197,7 @@ struct ati_remote {
|
||||
#define KIND_ACCEL 7 /* Directional keypad - left, right, up, down.*/
|
||||
|
||||
/* Translation table from hardware messages to input events. */
|
||||
static struct {
|
||||
static const struct {
|
||||
short kind;
|
||||
unsigned char data1, data2;
|
||||
int type;
|
||||
|
@@ -38,7 +38,7 @@ typedef s16 fixp_t;
|
||||
#define FRAC_MASK ((1<<FRAC_N)-1)
|
||||
|
||||
// Not to be used directly. Use fixp_{cos,sin}
|
||||
static fixp_t cos_table[45] = {
|
||||
static const fixp_t cos_table[45] = {
|
||||
0x0100, 0x00FF, 0x00FF, 0x00FE, 0x00FD, 0x00FC, 0x00FA, 0x00F8,
|
||||
0x00F6, 0x00F3, 0x00F0, 0x00ED, 0x00E9, 0x00E6, 0x00E2, 0x00DD,
|
||||
0x00D9, 0x00D4, 0x00CF, 0x00C9, 0x00C4, 0x00BE, 0x00B8, 0x00B1,
|
||||
|
@@ -1454,7 +1454,7 @@ void hid_init_reports(struct hid_device *hid)
|
||||
* Alphabetically sorted blacklist by quirk type.
|
||||
*/
|
||||
|
||||
static struct hid_blacklist {
|
||||
static const struct hid_blacklist {
|
||||
__u16 idVendor;
|
||||
__u16 idProduct;
|
||||
unsigned quirks;
|
||||
|
@@ -39,7 +39,7 @@
|
||||
|
||||
#define unk KEY_UNKNOWN
|
||||
|
||||
static unsigned char hid_keyboard[256] = {
|
||||
static const unsigned char hid_keyboard[256] = {
|
||||
0, 0, 0, 0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
|
||||
50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44, 2, 3,
|
||||
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] = {
|
||||
150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk
|
||||
};
|
||||
|
||||
static struct {
|
||||
static const struct {
|
||||
__s32 x;
|
||||
__s32 y;
|
||||
} hid_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
|
||||
|
@@ -95,7 +95,7 @@ struct usb_keyspan {
|
||||
* Currently there are 15 and 17 button models so RESERVED codes
|
||||
* are blank areas in the mapping.
|
||||
*/
|
||||
static int keyspan_key_table[] = {
|
||||
static const int keyspan_key_table[] = {
|
||||
KEY_RESERVED, /* 0 is just a place holder. */
|
||||
KEY_RESERVED,
|
||||
KEY_STOP,
|
||||
|
@@ -70,7 +70,7 @@
|
||||
|
||||
#define XPAD_PKT_LEN 32
|
||||
|
||||
static struct xpad_device {
|
||||
static const struct xpad_device {
|
||||
u16 idVendor;
|
||||
u16 idProduct;
|
||||
char *name;
|
||||
@@ -81,13 +81,13 @@ static struct xpad_device {
|
||||
{ 0x0000, 0x0000, "X-Box pad" }
|
||||
};
|
||||
|
||||
static signed short xpad_btn[] = {
|
||||
static const signed short xpad_btn[] = {
|
||||
BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, /* "analog" buttons */
|
||||
BTN_START, BTN_BACK, BTN_THUMBL, BTN_THUMBR, /* start/back/sticks */
|
||||
-1 /* terminating entry */
|
||||
};
|
||||
|
||||
static signed short xpad_abs[] = {
|
||||
static const signed short xpad_abs[] = {
|
||||
ABS_X, ABS_Y, /* left stick */
|
||||
ABS_RX, ABS_RY, /* right stick */
|
||||
ABS_Z, ABS_RZ, /* triggers left/right */
|
||||
|
Reference in New Issue
Block a user