diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-12-09 08:29:34 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-01-07 19:18:35 -0500 |
commit | 4d043101897768dfde30a6f2674fc7cec403d6b0 (patch) | |
tree | 84e4e7aa4082a1eceec91ee51a3524ec874d017a /drivers/hid/hid-roccat-kone.h | |
parent | 47dbdbffe15b9582a41727766d43f1d4208e977e (diff) |
HID: roccat: don't use #pragma pack
Replace #pragma pack ocurences with __atribute__((__packed__));
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-kone.h')
-rw-r--r-- | drivers/hid/hid-roccat-kone.h | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/hid/hid-roccat-kone.h b/drivers/hid/hid-roccat-kone.h index 11203a75b0f9..64abb5b8a59a 100644 --- a/drivers/hid/hid-roccat-kone.h +++ b/drivers/hid/hid-roccat-kone.h | |||
@@ -14,17 +14,11 @@ | |||
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | 16 | ||
17 | /* | ||
18 | * Binary data structures used for hardware communication must have no padding. | ||
19 | */ | ||
20 | #pragma pack(push) | ||
21 | #pragma pack(1) | ||
22 | |||
23 | struct kone_keystroke { | 17 | struct kone_keystroke { |
24 | uint8_t key; | 18 | uint8_t key; |
25 | uint8_t action; | 19 | uint8_t action; |
26 | uint16_t period; /* in milliseconds */ | 20 | uint16_t period; /* in milliseconds */ |
27 | }; | 21 | } __attribute__ ((__packed__)); |
28 | 22 | ||
29 | enum kone_keystroke_buttons { | 23 | enum kone_keystroke_buttons { |
30 | kone_keystroke_button_1 = 0xf0, /* left mouse button */ | 24 | kone_keystroke_button_1 = 0xf0, /* left mouse button */ |
@@ -47,7 +41,7 @@ struct kone_button_info { | |||
47 | uint8_t macro_name[16]; /* can be max 15 chars long */ | 41 | uint8_t macro_name[16]; /* can be max 15 chars long */ |
48 | uint8_t count; | 42 | uint8_t count; |
49 | struct kone_keystroke keystrokes[20]; | 43 | struct kone_keystroke keystrokes[20]; |
50 | }; | 44 | } __attribute__ ((__packed__)); |
51 | 45 | ||
52 | enum kone_button_info_types { | 46 | enum kone_button_info_types { |
53 | /* valid button types until firmware 1.32 */ | 47 | /* valid button types until firmware 1.32 */ |
@@ -98,7 +92,7 @@ struct kone_light_info { | |||
98 | uint8_t red; /* range 0x00-0xff */ | 92 | uint8_t red; /* range 0x00-0xff */ |
99 | uint8_t green; /* range 0x00-0xff */ | 93 | uint8_t green; /* range 0x00-0xff */ |
100 | uint8_t blue; /* range 0x00-0xff */ | 94 | uint8_t blue; /* range 0x00-0xff */ |
101 | }; | 95 | } __attribute__ ((__packed__)); |
102 | 96 | ||
103 | struct kone_profile { | 97 | struct kone_profile { |
104 | uint16_t size; /* always 975 */ | 98 | uint16_t size; /* always 975 */ |
@@ -133,7 +127,7 @@ struct kone_profile { | |||
133 | struct kone_button_info button_infos[8]; | 127 | struct kone_button_info button_infos[8]; |
134 | 128 | ||
135 | uint16_t checksum; /* \brief holds checksum of struct */ | 129 | uint16_t checksum; /* \brief holds checksum of struct */ |
136 | }; | 130 | } __attribute__ ((__packed__)); |
137 | 131 | ||
138 | enum kone_polling_rates { | 132 | enum kone_polling_rates { |
139 | kone_polling_rate_125 = 1, | 133 | kone_polling_rate_125 = 1, |
@@ -150,7 +144,7 @@ struct kone_settings { | |||
150 | uint8_t calibration_data[4]; | 144 | uint8_t calibration_data[4]; |
151 | uint8_t unknown3[2]; | 145 | uint8_t unknown3[2]; |
152 | uint16_t checksum; | 146 | uint16_t checksum; |
153 | }; | 147 | } __attribute__ ((__packed__)); |
154 | 148 | ||
155 | /* | 149 | /* |
156 | * 12 byte mouse event read by interrupt_read | 150 | * 12 byte mouse event read by interrupt_read |
@@ -166,7 +160,7 @@ struct kone_mouse_event { | |||
166 | uint8_t event; | 160 | uint8_t event; |
167 | uint8_t value; /* press = 0, release = 1 */ | 161 | uint8_t value; /* press = 0, release = 1 */ |
168 | uint8_t macro_key; /* 0 to 8 */ | 162 | uint8_t macro_key; /* 0 to 8 */ |
169 | }; | 163 | } __attribute__ ((__packed__)); |
170 | 164 | ||
171 | enum kone_mouse_events { | 165 | enum kone_mouse_events { |
172 | /* osd events are thought to be display on screen */ | 166 | /* osd events are thought to be display on screen */ |
@@ -194,9 +188,7 @@ struct kone_roccat_report { | |||
194 | uint8_t event; | 188 | uint8_t event; |
195 | uint8_t value; /* holds dpi or profile value */ | 189 | uint8_t value; /* holds dpi or profile value */ |
196 | uint8_t key; /* macro key on overlong macro execution */ | 190 | uint8_t key; /* macro key on overlong macro execution */ |
197 | }; | 191 | } __attribute__ ((__packed__)); |
198 | |||
199 | #pragma pack(pop) | ||
200 | 192 | ||
201 | struct kone_device { | 193 | struct kone_device { |
202 | /* | 194 | /* |