diff options
author | Paul Collins <paul@burly.ondioline.org> | 2009-03-06 23:07:15 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-03-30 09:12:54 -0400 |
commit | b2ddd54e19dfff559a02ec8e7e532357b3f09849 (patch) | |
tree | 39ca6f8fc1d005c9eedc2ae305edfbd2433f56fa /drivers/hid | |
parent | 794227415f8f5f395a9ed4269a4ee7a3c34f66a5 (diff) |
HID: constify arrays of struct apple_key_translation
Mark arrays of struct apple_key_translation const so that they may be placed in
.rodata, and adjust users to suit.
Signed-off-by: Paul Collins <paul@ondioline.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-apple.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 7ed94cf260d2..cab3be7ef0ab 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -53,7 +53,7 @@ struct apple_key_translation { | |||
53 | u8 flags; | 53 | u8 flags; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | static struct apple_key_translation apple_fn_keys[] = { | 56 | static const struct apple_key_translation apple_fn_keys[] = { |
57 | { KEY_BACKSPACE, KEY_DELETE }, | 57 | { KEY_BACKSPACE, KEY_DELETE }, |
58 | { KEY_ENTER, KEY_INSERT }, | 58 | { KEY_ENTER, KEY_INSERT }, |
59 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, | 59 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, |
@@ -75,7 +75,7 @@ static struct apple_key_translation apple_fn_keys[] = { | |||
75 | { } | 75 | { } |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static struct apple_key_translation powerbook_fn_keys[] = { | 78 | static const struct apple_key_translation powerbook_fn_keys[] = { |
79 | { KEY_BACKSPACE, KEY_DELETE }, | 79 | { KEY_BACKSPACE, KEY_DELETE }, |
80 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, | 80 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, |
81 | { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, | 81 | { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, |
@@ -94,7 +94,7 @@ static struct apple_key_translation powerbook_fn_keys[] = { | |||
94 | { } | 94 | { } |
95 | }; | 95 | }; |
96 | 96 | ||
97 | static struct apple_key_translation powerbook_numlock_keys[] = { | 97 | static const struct apple_key_translation powerbook_numlock_keys[] = { |
98 | { KEY_J, KEY_KP1 }, | 98 | { KEY_J, KEY_KP1 }, |
99 | { KEY_K, KEY_KP2 }, | 99 | { KEY_K, KEY_KP2 }, |
100 | { KEY_L, KEY_KP3 }, | 100 | { KEY_L, KEY_KP3 }, |
@@ -117,16 +117,16 @@ static struct apple_key_translation powerbook_numlock_keys[] = { | |||
117 | { } | 117 | { } |
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct apple_key_translation apple_iso_keyboard[] = { | 120 | static const struct apple_key_translation apple_iso_keyboard[] = { |
121 | { KEY_GRAVE, KEY_102ND }, | 121 | { KEY_GRAVE, KEY_102ND }, |
122 | { KEY_102ND, KEY_GRAVE }, | 122 | { KEY_102ND, KEY_GRAVE }, |
123 | { } | 123 | { } |
124 | }; | 124 | }; |
125 | 125 | ||
126 | static struct apple_key_translation *apple_find_translation( | 126 | static const struct apple_key_translation *apple_find_translation( |
127 | struct apple_key_translation *table, u16 from) | 127 | const struct apple_key_translation *table, u16 from) |
128 | { | 128 | { |
129 | struct apple_key_translation *trans; | 129 | const struct apple_key_translation *trans; |
130 | 130 | ||
131 | /* Look for the translation */ | 131 | /* Look for the translation */ |
132 | for (trans = table; trans->from; trans++) | 132 | for (trans = table; trans->from; trans++) |
@@ -140,7 +140,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, | |||
140 | struct hid_usage *usage, __s32 value) | 140 | struct hid_usage *usage, __s32 value) |
141 | { | 141 | { |
142 | struct apple_sc *asc = hid_get_drvdata(hid); | 142 | struct apple_sc *asc = hid_get_drvdata(hid); |
143 | struct apple_key_translation *trans; | 143 | const struct apple_key_translation *trans; |
144 | 144 | ||
145 | if (usage->code == KEY_FN) { | 145 | if (usage->code == KEY_FN) { |
146 | asc->fn_on = !!value; | 146 | asc->fn_on = !!value; |
@@ -253,7 +253,7 @@ static void apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
253 | 253 | ||
254 | static void apple_setup_input(struct input_dev *input) | 254 | static void apple_setup_input(struct input_dev *input) |
255 | { | 255 | { |
256 | struct apple_key_translation *trans; | 256 | const struct apple_key_translation *trans; |
257 | 257 | ||
258 | set_bit(KEY_NUMLOCK, input->keybit); | 258 | set_bit(KEY_NUMLOCK, input->keybit); |
259 | 259 | ||