diff options
author | Al Viro <viro@parcelfarce.linux.theplanet.co.uk> | 2005-08-27 22:19:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-29 13:42:39 -0400 |
commit | 9e2d3cd34a159948dc753a14573e16bffc04dba8 (patch) | |
tree | 155627810033ac56d06734360c56b612f08b9134 | |
parent | 5bbe6ab938208bb3d4e16f7a28b11fcddd4f9ff2 (diff) |
[PATCH] mod_devicetable.h fixes
* ieee1394_device_id has kernel_ulong_t field after an odd number of
__u32 ones. Since mod_devicetable.h is included both from kernel and
from host build helper, we may be in trouble if we are building on
32bit host for 64bit target - userland sees unsigned long long,
kernel sees unsigned long and while their sizes match, alignments
might not. Fixed by forcing alignment. Fortunately, almost nobody
else needs that - the rest of such fields is naturally aligned as it
is.
* of_device_id has void * in it. Host userland helpers need
kernel_ulong_t instead, since their void * might have nothing to do
with the kernel one. Fixed in the same way it's done for similar
problems in pcmcia_device_id (ifdef __KERNEL__).
* pcmcia_device_id has the same problem as ieee1394_device_id. Fixed
the same way.
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/mod_devicetable.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index dce53ac1625d..97bbccdbcca3 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -33,7 +33,8 @@ struct ieee1394_device_id { | |||
33 | __u32 model_id; | 33 | __u32 model_id; |
34 | __u32 specifier_id; | 34 | __u32 specifier_id; |
35 | __u32 version; | 35 | __u32 version; |
36 | kernel_ulong_t driver_data; | 36 | kernel_ulong_t driver_data |
37 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | 40 | ||
@@ -182,7 +183,11 @@ struct of_device_id | |||
182 | char name[32]; | 183 | char name[32]; |
183 | char type[32]; | 184 | char type[32]; |
184 | char compatible[128]; | 185 | char compatible[128]; |
186 | #if __KERNEL__ | ||
185 | void *data; | 187 | void *data; |
188 | #else | ||
189 | kernel_ulong_t data; | ||
190 | #endif | ||
186 | }; | 191 | }; |
187 | 192 | ||
188 | 193 | ||
@@ -208,7 +213,8 @@ struct pcmcia_device_id { | |||
208 | #ifdef __KERNEL__ | 213 | #ifdef __KERNEL__ |
209 | const char * prod_id[4]; | 214 | const char * prod_id[4]; |
210 | #else | 215 | #else |
211 | kernel_ulong_t prod_id[4]; | 216 | kernel_ulong_t prod_id[4] |
217 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
212 | #endif | 218 | #endif |
213 | 219 | ||
214 | /* not matched against */ | 220 | /* not matched against */ |