diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-08-22 13:25:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-23 00:15:39 -0400 |
commit | 09cd2b99c6cdd1e14e84c1febca2fb91e9f4e5ba (patch) | |
tree | 87d9c912d5d73a1017773a5b0d30d564e8a7895c /include | |
parent | 48d3ff82698cb0094684aed70446e0a5cbb1a4d0 (diff) |
header: fix broken headers for user space
__packed is only defined in kernel space, so we should use
__attribute__((packed)) for the code shared between kernel and user space.
Two __attribute() annotations are replaced with __attribute__() too.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_ether.h | 2 | ||||
-rw-r--r-- | include/linux/if_fddi.h | 8 | ||||
-rw-r--r-- | include/linux/if_hippi.h | 8 | ||||
-rw-r--r-- | include/linux/if_pppox.h | 10 | ||||
-rw-r--r-- | include/linux/ipv6.h | 4 | ||||
-rw-r--r-- | include/linux/nbd.h | 2 | ||||
-rw-r--r-- | include/linux/ncp.h | 10 | ||||
-rw-r--r-- | include/linux/netfilter/xt_IDLETIMER.h | 2 | ||||
-rw-r--r-- | include/linux/phonet.h | 4 | ||||
-rw-r--r-- | include/linux/rfkill.h | 2 |
10 files changed, 26 insertions, 26 deletions
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index c831467774d0..bed7a4682b90 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -119,7 +119,7 @@ struct ethhdr { | |||
119 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ | 119 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ |
120 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ | 120 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ |
121 | __be16 h_proto; /* packet type ID field */ | 121 | __be16 h_proto; /* packet type ID field */ |
122 | } __packed; | 122 | } __attribute__((packed)); |
123 | 123 | ||
124 | #ifdef __KERNEL__ | 124 | #ifdef __KERNEL__ |
125 | #include <linux/skbuff.h> | 125 | #include <linux/skbuff.h> |
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index 9947c39e62f6..e6dc11e7f9a5 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h | |||
@@ -67,7 +67,7 @@ struct fddi_8022_1_hdr { | |||
67 | __u8 dsap; /* destination service access point */ | 67 | __u8 dsap; /* destination service access point */ |
68 | __u8 ssap; /* source service access point */ | 68 | __u8 ssap; /* source service access point */ |
69 | __u8 ctrl; /* control byte #1 */ | 69 | __u8 ctrl; /* control byte #1 */ |
70 | } __packed; | 70 | } __attribute__((packed)); |
71 | 71 | ||
72 | /* Define 802.2 Type 2 header */ | 72 | /* Define 802.2 Type 2 header */ |
73 | struct fddi_8022_2_hdr { | 73 | struct fddi_8022_2_hdr { |
@@ -75,7 +75,7 @@ struct fddi_8022_2_hdr { | |||
75 | __u8 ssap; /* source service access point */ | 75 | __u8 ssap; /* source service access point */ |
76 | __u8 ctrl_1; /* control byte #1 */ | 76 | __u8 ctrl_1; /* control byte #1 */ |
77 | __u8 ctrl_2; /* control byte #2 */ | 77 | __u8 ctrl_2; /* control byte #2 */ |
78 | } __packed; | 78 | } __attribute__((packed)); |
79 | 79 | ||
80 | /* Define 802.2 SNAP header */ | 80 | /* Define 802.2 SNAP header */ |
81 | #define FDDI_K_OUI_LEN 3 | 81 | #define FDDI_K_OUI_LEN 3 |
@@ -85,7 +85,7 @@ struct fddi_snap_hdr { | |||
85 | __u8 ctrl; /* always 0x03 */ | 85 | __u8 ctrl; /* always 0x03 */ |
86 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ | 86 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ |
87 | __be16 ethertype; /* packet type ID field */ | 87 | __be16 ethertype; /* packet type ID field */ |
88 | } __packed; | 88 | } __attribute__((packed)); |
89 | 89 | ||
90 | /* Define FDDI LLC frame header */ | 90 | /* Define FDDI LLC frame header */ |
91 | struct fddihdr { | 91 | struct fddihdr { |
@@ -98,7 +98,7 @@ struct fddihdr { | |||
98 | struct fddi_8022_2_hdr llc_8022_2; | 98 | struct fddi_8022_2_hdr llc_8022_2; |
99 | struct fddi_snap_hdr llc_snap; | 99 | struct fddi_snap_hdr llc_snap; |
100 | } hdr; | 100 | } hdr; |
101 | } __packed; | 101 | } __attribute__((packed)); |
102 | 102 | ||
103 | #ifdef __KERNEL__ | 103 | #ifdef __KERNEL__ |
104 | #include <linux/netdevice.h> | 104 | #include <linux/netdevice.h> |
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h index 5fe5f307c6f5..cdc049f1829a 100644 --- a/include/linux/if_hippi.h +++ b/include/linux/if_hippi.h | |||
@@ -104,7 +104,7 @@ struct hippi_fp_hdr { | |||
104 | __be32 fixed; | 104 | __be32 fixed; |
105 | #endif | 105 | #endif |
106 | __be32 d2_size; | 106 | __be32 d2_size; |
107 | } __packed; | 107 | } __attribute__((packed)); |
108 | 108 | ||
109 | struct hippi_le_hdr { | 109 | struct hippi_le_hdr { |
110 | #if defined (__BIG_ENDIAN_BITFIELD) | 110 | #if defined (__BIG_ENDIAN_BITFIELD) |
@@ -129,7 +129,7 @@ struct hippi_le_hdr { | |||
129 | __u8 daddr[HIPPI_ALEN]; | 129 | __u8 daddr[HIPPI_ALEN]; |
130 | __u16 locally_administered; | 130 | __u16 locally_administered; |
131 | __u8 saddr[HIPPI_ALEN]; | 131 | __u8 saddr[HIPPI_ALEN]; |
132 | } __packed; | 132 | } __attribute__((packed)); |
133 | 133 | ||
134 | #define HIPPI_OUI_LEN 3 | 134 | #define HIPPI_OUI_LEN 3 |
135 | /* | 135 | /* |
@@ -142,12 +142,12 @@ struct hippi_snap_hdr { | |||
142 | __u8 ctrl; /* always 0x03 */ | 142 | __u8 ctrl; /* always 0x03 */ |
143 | __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ | 143 | __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ |
144 | __be16 ethertype; /* packet type ID field */ | 144 | __be16 ethertype; /* packet type ID field */ |
145 | } __packed; | 145 | } __attribute__((packed)); |
146 | 146 | ||
147 | struct hippi_hdr { | 147 | struct hippi_hdr { |
148 | struct hippi_fp_hdr fp; | 148 | struct hippi_fp_hdr fp; |
149 | struct hippi_le_hdr le; | 149 | struct hippi_le_hdr le; |
150 | struct hippi_snap_hdr snap; | 150 | struct hippi_snap_hdr snap; |
151 | } __packed; | 151 | } __attribute__((packed)); |
152 | 152 | ||
153 | #endif /* _LINUX_IF_HIPPI_H */ | 153 | #endif /* _LINUX_IF_HIPPI_H */ |
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 1925e0c3f162..27741e05446f 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
@@ -59,7 +59,7 @@ struct sockaddr_pppox { | |||
59 | union{ | 59 | union{ |
60 | struct pppoe_addr pppoe; | 60 | struct pppoe_addr pppoe; |
61 | }sa_addr; | 61 | }sa_addr; |
62 | } __packed; | 62 | } __attribute__((packed)); |
63 | 63 | ||
64 | /* The use of the above union isn't viable because the size of this | 64 | /* The use of the above union isn't viable because the size of this |
65 | * struct must stay fixed over time -- applications use sizeof(struct | 65 | * struct must stay fixed over time -- applications use sizeof(struct |
@@ -70,7 +70,7 @@ struct sockaddr_pppol2tp { | |||
70 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 70 | sa_family_t sa_family; /* address family, AF_PPPOX */ |
71 | unsigned int sa_protocol; /* protocol identifier */ | 71 | unsigned int sa_protocol; /* protocol identifier */ |
72 | struct pppol2tp_addr pppol2tp; | 72 | struct pppol2tp_addr pppol2tp; |
73 | } __packed; | 73 | } __attribute__((packed)); |
74 | 74 | ||
75 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 | 75 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 |
76 | * bits. So we need a different sockaddr structure. | 76 | * bits. So we need a different sockaddr structure. |
@@ -79,7 +79,7 @@ struct sockaddr_pppol2tpv3 { | |||
79 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 79 | sa_family_t sa_family; /* address family, AF_PPPOX */ |
80 | unsigned int sa_protocol; /* protocol identifier */ | 80 | unsigned int sa_protocol; /* protocol identifier */ |
81 | struct pppol2tpv3_addr pppol2tp; | 81 | struct pppol2tpv3_addr pppol2tp; |
82 | } __packed; | 82 | } __attribute__((packed)); |
83 | 83 | ||
84 | /********************************************************************* | 84 | /********************************************************************* |
85 | * | 85 | * |
@@ -101,7 +101,7 @@ struct pppoe_tag { | |||
101 | __be16 tag_type; | 101 | __be16 tag_type; |
102 | __be16 tag_len; | 102 | __be16 tag_len; |
103 | char tag_data[0]; | 103 | char tag_data[0]; |
104 | } __attribute ((packed)); | 104 | } __attribute__ ((packed)); |
105 | 105 | ||
106 | /* Tag identifiers */ | 106 | /* Tag identifiers */ |
107 | #define PTT_EOL __cpu_to_be16(0x0000) | 107 | #define PTT_EOL __cpu_to_be16(0x0000) |
@@ -129,7 +129,7 @@ struct pppoe_hdr { | |||
129 | __be16 sid; | 129 | __be16 sid; |
130 | __be16 length; | 130 | __be16 length; |
131 | struct pppoe_tag tag[0]; | 131 | struct pppoe_tag tag[0]; |
132 | } __packed; | 132 | } __attribute__((packed)); |
133 | 133 | ||
134 | /* Length of entire PPPoE + PPP header */ | 134 | /* Length of entire PPPoE + PPP header */ |
135 | #define PPPOE_SES_HLEN 8 | 135 | #define PPPOE_SES_HLEN 8 |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index ab9e9e89e407..e62683ba88e6 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -58,7 +58,7 @@ struct ipv6_opt_hdr { | |||
58 | /* | 58 | /* |
59 | * TLV encoded option data follows. | 59 | * TLV encoded option data follows. |
60 | */ | 60 | */ |
61 | } __packed; /* required for some archs */ | 61 | } __attribute__((packed)); /* required for some archs */ |
62 | 62 | ||
63 | #define ipv6_destopt_hdr ipv6_opt_hdr | 63 | #define ipv6_destopt_hdr ipv6_opt_hdr |
64 | #define ipv6_hopopt_hdr ipv6_opt_hdr | 64 | #define ipv6_hopopt_hdr ipv6_opt_hdr |
@@ -99,7 +99,7 @@ struct ipv6_destopt_hao { | |||
99 | __u8 type; | 99 | __u8 type; |
100 | __u8 length; | 100 | __u8 length; |
101 | struct in6_addr addr; | 101 | struct in6_addr addr; |
102 | } __packed; | 102 | } __attribute__((packed)); |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * IPv6 fixed header | 105 | * IPv6 fixed header |
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index bb58854a8061..d146ca10c0f5 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
@@ -88,7 +88,7 @@ struct nbd_request { | |||
88 | char handle[8]; | 88 | char handle[8]; |
89 | __be64 from; | 89 | __be64 from; |
90 | __be32 len; | 90 | __be32 len; |
91 | } __packed; | 91 | } __attribute__((packed)); |
92 | 92 | ||
93 | /* | 93 | /* |
94 | * This is the reply packet that nbd-server sends back to the client after | 94 | * This is the reply packet that nbd-server sends back to the client after |
diff --git a/include/linux/ncp.h b/include/linux/ncp.h index 3ace8370e61e..99f0adeeb3f3 100644 --- a/include/linux/ncp.h +++ b/include/linux/ncp.h | |||
@@ -27,7 +27,7 @@ struct ncp_request_header { | |||
27 | __u8 conn_high; | 27 | __u8 conn_high; |
28 | __u8 function; | 28 | __u8 function; |
29 | __u8 data[0]; | 29 | __u8 data[0]; |
30 | } __packed; | 30 | } __attribute__((packed)); |
31 | 31 | ||
32 | #define NCP_REPLY (0x3333) | 32 | #define NCP_REPLY (0x3333) |
33 | #define NCP_WATCHDOG (0x3E3E) | 33 | #define NCP_WATCHDOG (0x3E3E) |
@@ -42,7 +42,7 @@ struct ncp_reply_header { | |||
42 | __u8 completion_code; | 42 | __u8 completion_code; |
43 | __u8 connection_state; | 43 | __u8 connection_state; |
44 | __u8 data[0]; | 44 | __u8 data[0]; |
45 | } __packed; | 45 | } __attribute__((packed)); |
46 | 46 | ||
47 | #define NCP_VOLNAME_LEN (16) | 47 | #define NCP_VOLNAME_LEN (16) |
48 | #define NCP_NUMBER_OF_VOLUMES (256) | 48 | #define NCP_NUMBER_OF_VOLUMES (256) |
@@ -158,7 +158,7 @@ struct nw_info_struct { | |||
158 | #ifdef __KERNEL__ | 158 | #ifdef __KERNEL__ |
159 | struct nw_nfs_info nfs; | 159 | struct nw_nfs_info nfs; |
160 | #endif | 160 | #endif |
161 | } __packed; | 161 | } __attribute__((packed)); |
162 | 162 | ||
163 | /* modify mask - use with MODIFY_DOS_INFO structure */ | 163 | /* modify mask - use with MODIFY_DOS_INFO structure */ |
164 | #define DM_ATTRIBUTES (cpu_to_le32(0x02)) | 164 | #define DM_ATTRIBUTES (cpu_to_le32(0x02)) |
@@ -190,12 +190,12 @@ struct nw_modify_dos_info { | |||
190 | __u16 inheritanceGrantMask; | 190 | __u16 inheritanceGrantMask; |
191 | __u16 inheritanceRevokeMask; | 191 | __u16 inheritanceRevokeMask; |
192 | __u32 maximumSpace; | 192 | __u32 maximumSpace; |
193 | } __packed; | 193 | } __attribute__((packed)); |
194 | 194 | ||
195 | struct nw_search_sequence { | 195 | struct nw_search_sequence { |
196 | __u8 volNumber; | 196 | __u8 volNumber; |
197 | __u32 dirBase; | 197 | __u32 dirBase; |
198 | __u32 sequence; | 198 | __u32 sequence; |
199 | } __packed; | 199 | } __attribute__((packed)); |
200 | 200 | ||
201 | #endif /* _LINUX_NCP_H */ | 201 | #endif /* _LINUX_NCP_H */ |
diff --git a/include/linux/netfilter/xt_IDLETIMER.h b/include/linux/netfilter/xt_IDLETIMER.h index 3e1aa1be942e..208ae9387331 100644 --- a/include/linux/netfilter/xt_IDLETIMER.h +++ b/include/linux/netfilter/xt_IDLETIMER.h | |||
@@ -39,7 +39,7 @@ struct idletimer_tg_info { | |||
39 | char label[MAX_IDLETIMER_LABEL_SIZE]; | 39 | char label[MAX_IDLETIMER_LABEL_SIZE]; |
40 | 40 | ||
41 | /* for kernel module internal use only */ | 41 | /* for kernel module internal use only */ |
42 | struct idletimer_tg *timer __attribute((aligned(8))); | 42 | struct idletimer_tg *timer __attribute__((aligned(8))); |
43 | }; | 43 | }; |
44 | 44 | ||
45 | #endif | 45 | #endif |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index 24426c3d6b5a..76edadf046d3 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
@@ -56,7 +56,7 @@ struct phonethdr { | |||
56 | __be16 pn_length; | 56 | __be16 pn_length; |
57 | __u8 pn_robj; | 57 | __u8 pn_robj; |
58 | __u8 pn_sobj; | 58 | __u8 pn_sobj; |
59 | } __packed; | 59 | } __attribute__((packed)); |
60 | 60 | ||
61 | /* Common Phonet payload header */ | 61 | /* Common Phonet payload header */ |
62 | struct phonetmsg { | 62 | struct phonetmsg { |
@@ -98,7 +98,7 @@ struct sockaddr_pn { | |||
98 | __u8 spn_dev; | 98 | __u8 spn_dev; |
99 | __u8 spn_resource; | 99 | __u8 spn_resource; |
100 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | 100 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; |
101 | } __packed; | 101 | } __attribute__((packed)); |
102 | 102 | ||
103 | /* Well known address */ | 103 | /* Well known address */ |
104 | #define PN_DEV_PC 0x10 | 104 | #define PN_DEV_PC 0x10 |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 4f82326eb294..08c32e4f261a 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -81,7 +81,7 @@ struct rfkill_event { | |||
81 | __u8 type; | 81 | __u8 type; |
82 | __u8 op; | 82 | __u8 op; |
83 | __u8 soft, hard; | 83 | __u8 soft, hard; |
84 | } __packed; | 84 | } __attribute__((packed)); |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * We are planning to be backward and forward compatible with changes | 87 | * We are planning to be backward and forward compatible with changes |