__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.
Unified · Split
| @@ -119,7 +119,7 @@ struct ethhdr { · 118 unmodified lines | ||
| 119 | 119 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ |
| 120 | 120 | unsigned char h_source[ETH_ALEN]; /* source ether addr */ |
| 121 | 121 | __be16 h_proto; /* packet type ID field */ |
| 122 | −} __packed; | |
| 122 | +} __attribute__((packed)); | |
| 123 | 123 | |
| 124 | 124 | #ifdef __KERNEL__ |
| 125 | 125 | #include <linux/skbuff.h> |
| @@ -67,7 +67,7 @@ struct fddi_8022_1_hdr { · 66 unmodified lines | ||
| 67 | 67 | __u8 dsap; /* destination service access point */ |
| 68 | 68 | __u8 ssap; /* source service access point */ |
| 69 | 69 | __u8 ctrl; /* control byte #1 */ |
| 70 | −} __packed; | |
| 70 | +} __attribute__((packed)); | |
| 71 | 71 | |
| 72 | 72 | /* Define 802.2 Type 2 header */ |
| 73 | 73 | struct fddi_8022_2_hdr { |
| @@ -75,7 +75,7 @@ struct fddi_8022_2_hdr { · 1 unmodified line | ||
| 75 | 75 | __u8 ssap; /* source service access point */ |
| 76 | 76 | __u8 ctrl_1; /* control byte #1 */ |
| 77 | 77 | __u8 ctrl_2; /* control byte #2 */ |
| 78 | −} __packed; | |
| 78 | +} __attribute__((packed)); | |
| 79 | 79 | |
| 80 | 80 | /* Define 802.2 SNAP header */ |
| 81 | 81 | #define FDDI_K_OUI_LEN 3 |
| @@ -85,7 +85,7 @@ struct fddi_snap_hdr { · 3 unmodified lines | ||
| 85 | 85 | __u8 ctrl; /* always 0x03 */ |
| 86 | 86 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ |
| 87 | 87 | __be16 ethertype; /* packet type ID field */ |
| 88 | −} __packed; | |
| 88 | +} __attribute__((packed)); | |
| 89 | 89 | |
| 90 | 90 | /* Define FDDI LLC frame header */ |
| 91 | 91 | struct fddihdr { |
| @@ -98,7 +98,7 @@ struct fddihdr { · 6 unmodified lines | ||
| 98 | 98 | struct fddi_8022_2_hdr llc_8022_2; |
| 99 | 99 | struct fddi_snap_hdr llc_snap; |
| 100 | 100 | } hdr; |
| 101 | −} __packed; | |
| 101 | +} __attribute__((packed)); | |
| 102 | 102 | |
| 103 | 103 | #ifdef __KERNEL__ |
| 104 | 104 | #include <linux/netdevice.h> |
| @@ -104,7 +104,7 @@ struct hippi_fp_hdr { · 103 unmodified lines | ||
| 104 | 104 | __be32 fixed; |
| 105 | 105 | #endif |
| 106 | 106 | __be32 d2_size; |
| 107 | −} __packed; | |
| 107 | +} __attribute__((packed)); | |
| 108 | 108 | |
| 109 | 109 | struct hippi_le_hdr { |
| 110 | 110 | #if defined (__BIG_ENDIAN_BITFIELD) |
| @@ -129,7 +129,7 @@ struct hippi_le_hdr { · 18 unmodified lines | ||
| 129 | 129 | __u8 daddr[HIPPI_ALEN]; |
| 130 | 130 | __u16 locally_administered; |
| 131 | 131 | __u8 saddr[HIPPI_ALEN]; |
| 132 | −} __packed; | |
| 132 | +} __attribute__((packed)); | |
| 133 | 133 | |
| 134 | 134 | #define HIPPI_OUI_LEN 3 |
| 135 | 135 | /* |
| @@ -142,12 +142,12 @@ struct hippi_snap_hdr { · 6 unmodified lines | ||
| 142 | 142 | __u8 ctrl; /* always 0x03 */ |
| 143 | 143 | __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ |
| 144 | 144 | __be16 ethertype; /* packet type ID field */ |
| 145 | −} __packed; | |
| 145 | +} __attribute__((packed)); | |
| 146 | 146 | |
| 147 | 147 | struct hippi_hdr { |
| 148 | 148 | struct hippi_fp_hdr fp; |
| 149 | 149 | struct hippi_le_hdr le; |
| 150 | 150 | struct hippi_snap_hdr snap; |
| 151 | −} __packed; | |
| 151 | +} __attribute__((packed)); | |
| 152 | 152 | |
| 153 | 153 | #endif /* _LINUX_IF_HIPPI_H */ |
| @@ -59,7 +59,7 @@ struct sockaddr_pppox { · 58 unmodified lines | ||
| 59 | 59 | union{ |
| 60 | 60 | struct pppoe_addr pppoe; |
| 61 | 61 | }sa_addr; |
| 62 | −} __packed; | |
| 62 | +} __attribute__((packed)); | |
| 63 | 63 | |
| 64 | 64 | /* The use of the above union isn't viable because the size of this |
| 65 | 65 | * struct must stay fixed over time -- applications use sizeof(struct |
| @@ -70,7 +70,7 @@ struct sockaddr_pppol2tp { · 4 unmodified lines | ||
| 70 | 70 | sa_family_t sa_family; /* address family, AF_PPPOX */ |
| 71 | 71 | unsigned int sa_protocol; /* protocol identifier */ |
| 72 | 72 | struct pppol2tp_addr pppol2tp; |
| 73 | −} __packed; | |
| 73 | +} __attribute__((packed)); | |
| 74 | 74 | |
| 75 | 75 | /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 |
| 76 | 76 | * bits. So we need a different sockaddr structure. |
| @@ -79,7 +79,7 @@ struct sockaddr_pppol2tpv3 { · 2 unmodified lines | ||
| 79 | 79 | sa_family_t sa_family; /* address family, AF_PPPOX */ |
| 80 | 80 | unsigned int sa_protocol; /* protocol identifier */ |
| 81 | 81 | struct pppol2tpv3_addr pppol2tp; |
| 82 | −} __packed; | |
| 82 | +} __attribute__((packed)); | |
| 83 | 83 | |
| 84 | 84 | /********************************************************************* |
| 85 | 85 | * |
| @@ -101,7 +101,7 @@ struct pppoe_tag { · 15 unmodified lines | ||
| 101 | 101 | __be16 tag_type; |
| 102 | 102 | __be16 tag_len; |
| 103 | 103 | char tag_data[0]; |
| 104 | −} __attribute ((packed)); | |
| 104 | +} __attribute__ ((packed)); | |
| 105 | 105 | |
| 106 | 106 | /* Tag identifiers */ |
| 107 | 107 | #define PTT_EOL __cpu_to_be16(0x0000) |
| @@ -129,7 +129,7 @@ struct pppoe_hdr { · 21 unmodified lines | ||
| 129 | 129 | __be16 sid; |
| 130 | 130 | __be16 length; |
| 131 | 131 | struct pppoe_tag tag[0]; |
| 132 | −} __packed; | |
| 132 | +} __attribute__((packed)); | |
| 133 | 133 | |
| 134 | 134 | /* Length of entire PPPoE + PPP header */ |
| 135 | 135 | #define PPPOE_SES_HLEN 8 |
| @@ -58,7 +58,7 @@ struct ipv6_opt_hdr { · 57 unmodified lines | ||
| 58 | 58 | /* |
| 59 | 59 | * TLV encoded option data follows. |
| 60 | 60 | */ |
| 61 | −} __packed; /* required for some archs */ | |
| 61 | +} __attribute__((packed)); /* required for some archs */ | |
| 62 | 62 | |
| 63 | 63 | #define ipv6_destopt_hdr ipv6_opt_hdr |
| 64 | 64 | #define ipv6_hopopt_hdr ipv6_opt_hdr |
| @@ -99,7 +99,7 @@ struct ipv6_destopt_hao { · 34 unmodified lines | ||
| 99 | 99 | __u8 type; |
| 100 | 100 | __u8 length; |
| 101 | 101 | struct in6_addr addr; |
| 102 | −} __packed; | |
| 102 | +} __attribute__((packed)); | |
| 103 | 103 | |
| 104 | 104 | /* |
| 105 | 105 | * IPv6 fixed header |
| @@ -88,7 +88,7 @@ struct nbd_request { · 87 unmodified lines | ||
| 88 | 88 | char handle[8]; |
| 89 | 89 | __be64 from; |
| 90 | 90 | __be32 len; |
| 91 | −} __packed; | |
| 91 | +} __attribute__((packed)); | |
| 92 | 92 | |
| 93 | 93 | /* |
| 94 | 94 | * This is the reply packet that nbd-server sends back to the client after |
| @@ -27,7 +27,7 @@ struct ncp_request_header { · 26 unmodified lines | ||
| 27 | 27 | __u8 conn_high; |
| 28 | 28 | __u8 function; |
| 29 | 29 | __u8 data[0]; |
| 30 | −} __packed; | |
| 30 | +} __attribute__((packed)); | |
| 31 | 31 | |
| 32 | 32 | #define NCP_REPLY (0x3333) |
| 33 | 33 | #define NCP_WATCHDOG (0x3E3E) |
| @@ -42,7 +42,7 @@ struct ncp_reply_header { · 8 unmodified lines | ||
| 42 | 42 | __u8 completion_code; |
| 43 | 43 | __u8 connection_state; |
| 44 | 44 | __u8 data[0]; |
| 45 | −} __packed; | |
| 45 | +} __attribute__((packed)); | |
| 46 | 46 | |
| 47 | 47 | #define NCP_VOLNAME_LEN (16) |
| 48 | 48 | #define NCP_NUMBER_OF_VOLUMES (256) |
| @@ -158,7 +158,7 @@ struct nw_info_struct { · 109 unmodified lines | ||
| 158 | 158 | #ifdef __KERNEL__ |
| 159 | 159 | struct nw_nfs_info nfs; |
| 160 | 160 | #endif |
| 161 | −} __packed; | |
| 161 | +} __attribute__((packed)); | |
| 162 | 162 | |
| 163 | 163 | /* modify mask - use with MODIFY_DOS_INFO structure */ |
| 164 | 164 | #define DM_ATTRIBUTES (cpu_to_le32(0x02)) |
| @@ -190,12 +190,12 @@ struct nw_modify_dos_info { · 25 unmodified lines | ||
| 190 | 190 | __u16 inheritanceGrantMask; |
| 191 | 191 | __u16 inheritanceRevokeMask; |
| 192 | 192 | __u32 maximumSpace; |
| 193 | −} __packed; | |
| 193 | +} __attribute__((packed)); | |
| 194 | 194 | |
| 195 | 195 | struct nw_search_sequence { |
| 196 | 196 | __u8 volNumber; |
| 197 | 197 | __u32 dirBase; |
| 198 | 198 | __u32 sequence; |
| 199 | −} __packed; | |
| 199 | +} __attribute__((packed)); | |
| 200 | 200 | |
| 201 | 201 | #endif /* _LINUX_NCP_H */ |
| @@ -39,7 +39,7 @@ struct idletimer_tg_info { · 38 unmodified lines | ||
| 39 | 39 | char label[MAX_IDLETIMER_LABEL_SIZE]; |
| 40 | 40 | |
| 41 | 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 | 45 | #endif |
| @@ -56,7 +56,7 @@ struct phonethdr { · 55 unmodified lines | ||
| 56 | 56 | __be16 pn_length; |
| 57 | 57 | __u8 pn_robj; |
| 58 | 58 | __u8 pn_sobj; |
| 59 | −} __packed; | |
| 59 | +} __attribute__((packed)); | |
| 60 | 60 | |
| 61 | 61 | /* Common Phonet payload header */ |
| 62 | 62 | struct phonetmsg { |
| @@ -98,7 +98,7 @@ struct sockaddr_pn { · 35 unmodified lines | ||
| 98 | 98 | __u8 spn_dev; |
| 99 | 99 | __u8 spn_resource; |
| 100 | 100 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; |
| 101 | −} __packed; | |
| 101 | +} __attribute__((packed)); | |
| 102 | 102 | |
| 103 | 103 | /* Well known address */ |
| 104 | 104 | #define PN_DEV_PC 0x10 |
| @@ -81,7 +81,7 @@ struct rfkill_event { · 80 unmodified lines | ||
| 81 | 81 | __u8 type; |
| 82 | 82 | __u8 op; |
| 83 | 83 | __u8 soft, hard; |
| 84 | −} __packed; | |
| 84 | +} __attribute__((packed)); | |
| 85 | 85 | |
| 86 | 86 | /* |
| 87 | 87 | * We are planning to be backward and forward compatible with changes |