]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
[PATCH] mod_devicetable.h fixes
authorAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sun, 28 Aug 2005 02:19:14 +0000 (03:19 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 29 Aug 2005 17:42:39 +0000 (10:42 -0700)
 * 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>
include/linux/mod_devicetable.h

index dce53ac1625d8cea5c78b1940aedc6441dc52d63..97bbccdbcca3f373b85d257d914099d13b4b89dd 100644 (file)
@@ -33,7 +33,8 @@ struct ieee1394_device_id {
        __u32 model_id;
        __u32 specifier_id;
        __u32 version;
-       kernel_ulong_t driver_data;
+       kernel_ulong_t driver_data
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
 };
 
 
@@ -182,7 +183,11 @@ struct of_device_id
        char    name[32];
        char    type[32];
        char    compatible[128];
+#if __KERNEL__
        void    *data;
+#else
+       kernel_ulong_t data;
+#endif
 };
 
 
@@ -208,7 +213,8 @@ struct pcmcia_device_id {
 #ifdef __KERNEL__
        const char *    prod_id[4];
 #else
-       kernel_ulong_t  prod_id[4];
+       kernel_ulong_t  prod_id[4]
+               __attribute__((aligned(sizeof(kernel_ulong_t))));
 #endif
 
        /* not matched against */