Commit ba2d3587 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

drivers/net: use __packed annotation



cleanup patch.

Use new __packed annotation in drivers/net/
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1273d976
...@@ -34,7 +34,7 @@ struct mc32_mailbox ...@@ -34,7 +34,7 @@ struct mc32_mailbox
{ {
u16 mbox; u16 mbox;
u16 data[1]; u16 data[1];
} __attribute((packed)); } __packed;
struct skb_header struct skb_header
{ {
...@@ -43,7 +43,7 @@ struct skb_header ...@@ -43,7 +43,7 @@ struct skb_header
u16 next; /* Do not change! */ u16 next; /* Do not change! */
u16 length; u16 length;
u32 data; u32 data;
} __attribute((packed)); } __packed;
struct mc32_stats struct mc32_stats
{ {
...@@ -68,7 +68,7 @@ struct mc32_stats ...@@ -68,7 +68,7 @@ struct mc32_stats
u32 dataA[6]; u32 dataA[6];
u16 dataB[5]; u16 dataB[5];
u32 dataC[14]; u32 dataC[14];
} __attribute((packed)); } __packed;
#define STATUS_MASK 0x0F #define STATUS_MASK 0x0F
#define COMPLETED (1<<7) #define COMPLETED (1<<7)
......
...@@ -322,7 +322,7 @@ struct cp_dma_stats { ...@@ -322,7 +322,7 @@ struct cp_dma_stats {
__le32 rx_ok_mcast; __le32 rx_ok_mcast;
__le16 tx_abort; __le16 tx_abort;
__le16 tx_underrun; __le16 tx_underrun;
} __attribute__((packed)); } __packed;
struct cp_extra_stats { struct cp_extra_stats {
unsigned long rx_frags; unsigned long rx_frags;
......
...@@ -436,8 +436,8 @@ struct rx_free_desc { ...@@ -436,8 +436,8 @@ struct rx_free_desc {
__le16 buf_len; /* Size of the receive buffer in host memory */ __le16 buf_len; /* Size of the receive buffer in host memory */
u16 coalese; /* Update consumer index to host after the u16 coalese; /* Update consumer index to host after the
* reception of this frame */ * reception of this frame */
/* __attribute__ ((packed)) is required */ /* __packed is required */
} __attribute__ ((packed)); } __packed;
/* /*
* The L1 transmit packet descriptor is comprised of four 32-bit words. * The L1 transmit packet descriptor is comprised of four 32-bit words.
......
...@@ -227,7 +227,7 @@ struct mscan_regs { ...@@ -227,7 +227,7 @@ struct mscan_regs {
u16 time; /* + 0x7c 0x3e */ u16 time; /* + 0x7c 0x3e */
} tx; } tx;
_MSCAN_RESERVED_(32, 2); /* + 0x7e */ _MSCAN_RESERVED_(32, 2); /* + 0x7e */
} __attribute__ ((packed)); } __packed;
#undef _MSCAN_RESERVED_ #undef _MSCAN_RESERVED_
#define MSCAN_REGION sizeof(struct mscan) #define MSCAN_REGION sizeof(struct mscan)
......
...@@ -197,7 +197,7 @@ struct cpc_can_err_counter { ...@@ -197,7 +197,7 @@ struct cpc_can_err_counter {
}; };
/* Main message type used between library and application */ /* Main message type used between library and application */
struct __attribute__ ((packed)) ems_cpc_msg { struct __packed ems_cpc_msg {
u8 type; /* type of message */ u8 type; /* type of message */
u8 length; /* length of data within union 'msg' */ u8 length; /* length of data within union 'msg' */
u8 msgid; /* confirmation handle */ u8 msgid; /* confirmation handle */
......
...@@ -961,7 +961,7 @@ struct dm9000_rxhdr { ...@@ -961,7 +961,7 @@ struct dm9000_rxhdr {
u8 RxPktReady; u8 RxPktReady;
u8 RxStatus; u8 RxStatus;
__le16 RxLen; __le16 RxLen;
} __attribute__((__packed__)); } __packed;
/* /*
* Received a packet and pass to upper layer * Received a packet and pass to upper layer
......
...@@ -126,7 +126,7 @@ struct ehea_swqe { ...@@ -126,7 +126,7 @@ struct ehea_swqe {
u8 immediate_data[SWQE2_MAX_IMM]; u8 immediate_data[SWQE2_MAX_IMM];
/* 0xd0 */ /* 0xd0 */
struct ehea_vsgentry sg_list[EHEA_MAX_WQE_SG_ENTRIES-1]; struct ehea_vsgentry sg_list[EHEA_MAX_WQE_SG_ENTRIES-1];
} immdata_desc __attribute__ ((packed)); } immdata_desc __packed;
/* Send WQE Format 3 */ /* Send WQE Format 3 */
struct { struct {
......
...@@ -44,7 +44,7 @@ struct vic_provinfo { ...@@ -44,7 +44,7 @@ struct vic_provinfo {
u16 length; u16 length;
u8 value[0]; u8 value[0];
} tlv[0]; } tlv[0];
} __attribute__ ((packed)); } __packed;
#define VIC_PROVINFO_MAX_DATA 1385 #define VIC_PROVINFO_MAX_DATA 1385
#define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \ #define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \
......
...@@ -39,7 +39,7 @@ struct fsl_pq_mdio { ...@@ -39,7 +39,7 @@ struct fsl_pq_mdio {
u8 reserved[28]; /* Space holder */ u8 reserved[28]; /* Space holder */
u32 utbipar; /* TBI phy address reg (only on UCC) */ u32 utbipar; /* TBI phy address reg (only on UCC) */
u8 res4[2728]; u8 res4[2728];
} __attribute__ ((packed)); } __packed;
int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum); int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); int fsl_pq_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
......
...@@ -273,7 +273,7 @@ struct OboeSlot ...@@ -273,7 +273,7 @@ struct OboeSlot
__u8 control; /*Slot control/status see below */ __u8 control; /*Slot control/status see below */
__u32 address; /*Slot buffer address */ __u32 address; /*Slot buffer address */
} }
__attribute__ ((packed)); __packed;
#define OBOE_NTASKS OBOE_TXRING_OFFSET_IN_SLOTS #define OBOE_NTASKS OBOE_TXRING_OFFSET_IN_SLOTS
......
...@@ -125,7 +125,7 @@ struct irda_class_desc { ...@@ -125,7 +125,7 @@ struct irda_class_desc {
__u8 bmAdditionalBOFs; __u8 bmAdditionalBOFs;
__u8 bIrdaRateSniff; __u8 bIrdaRateSniff;
__u8 bMaxUnicastList; __u8 bMaxUnicastList;
} __attribute__ ((packed)); } __packed;
/* class specific interface request to get the IrDA-USB class descriptor /* class specific interface request to get the IrDA-USB class descriptor
* (6.2.5, USB-IrDA class spec 1.0) */ * (6.2.5, USB-IrDA class spec 1.0) */
......
...@@ -154,7 +154,7 @@ struct ks959_speedparams { ...@@ -154,7 +154,7 @@ struct ks959_speedparams {
__le32 baudrate; /* baud rate, little endian */ __le32 baudrate; /* baud rate, little endian */
__u8 flags; __u8 flags;
__u8 reserved[3]; __u8 reserved[3];
} __attribute__ ((packed)); } __packed;
#define KS_DATA_5_BITS 0x00 #define KS_DATA_5_BITS 0x00
#define KS_DATA_6_BITS 0x01 #define KS_DATA_6_BITS 0x01
......
...@@ -117,7 +117,7 @@ struct ksdazzle_speedparams { ...@@ -117,7 +117,7 @@ struct ksdazzle_speedparams {
__le32 baudrate; /* baud rate, little endian */ __le32 baudrate; /* baud rate, little endian */
__u8 flags; __u8 flags;
__u8 reserved[3]; __u8 reserved[3];
} __attribute__ ((packed)); } __packed;
#define KS_DATA_5_BITS 0x00 #define KS_DATA_5_BITS 0x00
#define KS_DATA_6_BITS 0x01 #define KS_DATA_6_BITS 0x01
......
...@@ -544,9 +544,9 @@ struct ring_descr_hw { ...@@ -544,9 +544,9 @@ struct ring_descr_hw {
struct { struct {
u8 addr_res[3]; u8 addr_res[3];
volatile u8 status; /* descriptor status */ volatile u8 status; /* descriptor status */
} __attribute__((packed)) rd_s; } __packed rd_s;
} __attribute((packed)) rd_u; } __packed rd_u;
} __attribute__ ((packed)); } __packed;
#define rd_addr rd_u.addr #define rd_addr rd_u.addr
#define rd_status rd_u.rd_s.status #define rd_status rd_u.rd_s.status
......
...@@ -110,7 +110,7 @@ struct mlx4_eqe { ...@@ -110,7 +110,7 @@ struct mlx4_eqe {
u32 raw[6]; u32 raw[6];
struct { struct {
__be32 cqn; __be32 cqn;
} __attribute__((packed)) comp; } __packed comp;
struct { struct {
u16 reserved1; u16 reserved1;
__be16 token; __be16 token;
...@@ -118,27 +118,27 @@ struct mlx4_eqe { ...@@ -118,27 +118,27 @@ struct mlx4_eqe {
u8 reserved3[3]; u8 reserved3[3];
u8 status; u8 status;
__be64 out_param; __be64 out_param;
} __attribute__((packed)) cmd; } __packed cmd;
struct { struct {
__be32 qpn; __be32 qpn;
} __attribute__((packed)) qp; } __packed qp;
struct { struct {
__be32 srqn; __be32 srqn;
} __attribute__((packed)) srq; } __packed srq;
struct { struct {
__be32 cqn; __be32 cqn;
u32 reserved1; u32 reserved1;
u8 reserved2[3]; u8 reserved2[3];
u8 syndrome; u8 syndrome;
} __attribute__((packed)) cq_err; } __packed cq_err;
struct { struct {
u32 reserved1[2]; u32 reserved1[2];
__be32 port; __be32 port;
} __attribute__((packed)) port_change; } __packed port_change;
} event; } event;
u8 reserved3[3]; u8 reserved3[3];
u8 owner; u8 owner;
} __attribute__((packed)); } __packed;
static void eq_set_ci(struct mlx4_eq *eq, int req_not) static void eq_set_ci(struct mlx4_eq *eq, int req_not)
{ {
......
...@@ -58,7 +58,7 @@ struct mlx4_mpt_entry { ...@@ -58,7 +58,7 @@ struct mlx4_mpt_entry {
__be32 mtt_sz; __be32 mtt_sz;
__be32 entity_size; __be32 entity_size;
__be32 first_byte_offset; __be32 first_byte_offset;
} __attribute__((packed)); } __packed;
#define MLX4_MPT_FLAG_SW_OWNS (0xfUL << 28) #define MLX4_MPT_FLAG_SW_OWNS (0xfUL << 28)
#define MLX4_MPT_FLAG_FREE (0x3UL << 28) #define MLX4_MPT_FLAG_FREE (0x3UL << 28)
......
...@@ -74,7 +74,7 @@ struct gelic_eurus_common_cfg { ...@@ -74,7 +74,7 @@ struct gelic_eurus_common_cfg {
u16 bss_type; /* infra or adhoc */ u16 bss_type; /* infra or adhoc */
u16 auth_method; /* shared key or open */ u16 auth_method; /* shared key or open */
u16 op_mode; /* B/G */ u16 op_mode; /* B/G */
} __attribute__((packed)); } __packed;
/* for GELIC_EURUS_CMD_WEP_CFG */ /* for GELIC_EURUS_CMD_WEP_CFG */
...@@ -88,7 +88,7 @@ struct gelic_eurus_wep_cfg { ...@@ -88,7 +88,7 @@ struct gelic_eurus_wep_cfg {
/* all fields are big endian */ /* all fields are big endian */
u16 security; u16 security;
u8 key[4][16]; u8 key[4][16];
} __attribute__((packed)); } __packed;
/* for GELIC_EURUS_CMD_WPA_CFG */ /* for GELIC_EURUS_CMD_WPA_CFG */
enum gelic_eurus_wpa_security { enum gelic_eurus_wpa_security {
...@@ -120,7 +120,7 @@ struct gelic_eurus_wpa_cfg { ...@@ -120,7 +120,7 @@ struct gelic_eurus_wpa_cfg {
u16 security; u16 security;
u16 psk_type; /* psk key encoding type */ u16 psk_type; /* psk key encoding type */
u8 psk[GELIC_WL_EURUS_PSK_MAX_LEN]; /* psk key; hex or passphrase */ u8 psk[GELIC_WL_EURUS_PSK_MAX_LEN]; /* psk key; hex or passphrase */
} __attribute__((packed)); } __packed;
/* for GELIC_EURUS_CMD_{START,GET}_SCAN */ /* for GELIC_EURUS_CMD_{START,GET}_SCAN */
enum gelic_eurus_scan_capability { enum gelic_eurus_scan_capability {
...@@ -171,7 +171,7 @@ struct gelic_eurus_scan_info { ...@@ -171,7 +171,7 @@ struct gelic_eurus_scan_info {
__be32 reserved3; __be32 reserved3;
__be32 reserved4; __be32 reserved4;
u8 elements[0]; /* ie */ u8 elements[0]; /* ie */
} __attribute__ ((packed)); } __packed;
/* the hypervisor returns bbs up to 16 */ /* the hypervisor returns bbs up to 16 */
#define GELIC_EURUS_MAX_SCAN (16) #define GELIC_EURUS_MAX_SCAN (16)
...@@ -193,7 +193,7 @@ struct gelic_wl_scan_info { ...@@ -193,7 +193,7 @@ struct gelic_wl_scan_info {
struct gelic_eurus_rssi_info { struct gelic_eurus_rssi_info {
/* big endian */ /* big endian */
__be16 rssi; __be16 rssi;
} __attribute__ ((packed)); } __packed;
/* for 'stat' member of gelic_wl_info */ /* for 'stat' member of gelic_wl_info */
......
...@@ -1062,7 +1062,7 @@ struct tx_buf_desc { ...@@ -1062,7 +1062,7 @@ struct tx_buf_desc {
#define TX_DESC_LEN_MASK 0x000fffff #define TX_DESC_LEN_MASK 0x000fffff
#define TX_DESC_C 0x40000000 #define TX_DESC_C 0x40000000
#define TX_DESC_E 0x80000000 #define TX_DESC_E 0x80000000
} __attribute((packed)); } __packed;
/* /*
* IOCB Definitions... * IOCB Definitions...
...@@ -1095,7 +1095,7 @@ struct ob_mac_iocb_req { ...@@ -1095,7 +1095,7 @@ struct ob_mac_iocb_req {
__le16 vlan_tci; __le16 vlan_tci;
__le16 reserved4; __le16 reserved4;
struct tx_buf_desc tbd[TX_DESC_PER_IOCB]; struct tx_buf_desc tbd[TX_DESC_PER_IOCB];
} __attribute((packed)); } __packed;
struct ob_mac_iocb_rsp { struct ob_mac_iocb_rsp {
u8 opcode; /* */ u8 opcode; /* */
...@@ -1112,7 +1112,7 @@ struct ob_mac_iocb_rsp { ...@@ -1112,7 +1112,7 @@ struct ob_mac_iocb_rsp {
u32 tid; u32 tid;
u32 txq_idx; u32 txq_idx;
__le32 reserved[13]; __le32 reserved[13];
} __attribute((packed)); } __packed;
struct ob_mac_tso_iocb_req { struct ob_mac_tso_iocb_req {
u8 opcode; u8 opcode;
...@@ -1140,7 +1140,7 @@ struct ob_mac_tso_iocb_req { ...@@ -1140,7 +1140,7 @@ struct ob_mac_tso_iocb_req {
__le16 vlan_tci; __le16 vlan_tci;
__le16 mss; __le16 mss;
struct tx_buf_desc tbd[TX_DESC_PER_IOCB]; struct tx_buf_desc tbd[TX_DESC_PER_IOCB];
} __attribute((packed)); } __packed;
struct ob_mac_tso_iocb_rsp { struct ob_mac_tso_iocb_rsp {
u8 opcode; u8 opcode;
...@@ -1157,7 +1157,7 @@ struct ob_mac_tso_iocb_rsp { ...@@ -1157,7 +1157,7 @@ struct ob_mac_tso_iocb_rsp {
u32 tid; u32 tid;
u32 txq_idx; u32 txq_idx;
__le32 reserved2[13]; __le32 reserved2[13];
} __attribute((packed)); } __packed;
struct ib_mac_iocb_rsp { struct ib_mac_iocb_rsp {
u8 opcode; /* 0x20 */ u8 opcode; /* 0x20 */
...@@ -1216,7 +1216,7 @@ struct ib_mac_iocb_rsp { ...@@ -1216,7 +1216,7 @@ struct ib_mac_iocb_rsp {
#define IB_MAC_IOCB_RSP_HL 0x80 #define IB_MAC_IOCB_RSP_HL 0x80
__le32 hdr_len; /* */ __le32 hdr_len; /* */
__le64 hdr_addr; /* */ __le64 hdr_addr; /* */
} __attribute((packed)); } __packed;
struct ib_ae_iocb_rsp { struct ib_ae_iocb_rsp {
u8 opcode; u8 opcode;
...@@ -1237,7 +1237,7 @@ struct ib_ae_iocb_rsp { ...@@ -1237,7 +1237,7 @@ struct ib_ae_iocb_rsp {
#define PCI_ERR_ANON_BUF_RD 0x40 #define PCI_ERR_ANON_BUF_RD 0x40
u8 q_id; u8 q_id;
__le32 reserved[15]; __le32 reserved[15];
} __attribute((packed)); } __packed;
/* /*
* These three structures are for generic * These three structures are for generic
...@@ -1249,7 +1249,7 @@ struct ql_net_rsp_iocb { ...@@ -1249,7 +1249,7 @@ struct ql_net_rsp_iocb {
__le16 length; __le16 length;
__le32 tid; __le32 tid;
__le32 reserved[14]; __le32 reserved[14];
} __attribute((packed)); } __packed;
struct net_req_iocb { struct net_req_iocb {
u8 opcode; u8 opcode;
...@@ -1257,7 +1257,7 @@ struct net_req_iocb { ...@@ -1257,7 +1257,7 @@ struct net_req_iocb {
__le16 flags1; __le16 flags1;
__le32 tid; __le32 tid;
__le32 reserved1[30]; __le32 reserved1[30];
} __attribute((packed)); } __packed;
/* /*
* tx ring initialization control block for chip. * tx ring initialization control block for chip.
...@@ -1283,7 +1283,7 @@ struct wqicb { ...@@ -1283,7 +1283,7 @@ struct wqicb {
__le16 rid; __le16 rid;
__le64 addr; __le64 addr;
__le64 cnsmr_idx_addr; __le64 cnsmr_idx_addr;
} __attribute((packed)); } __packed;
/* /*
* rx ring initialization control block for chip. * rx ring initialization control block for chip.
...@@ -1317,7 +1317,7 @@ struct cqicb { ...@@ -1317,7 +1317,7 @@ struct cqicb {
__le64 sbq_addr; __le64 sbq_addr;
__le16 sbq_buf_size; __le16 sbq_buf_size;
__le16 sbq_len; /* entry count */ __le16 sbq_len; /* entry count */
} __attribute((packed)); } __packed;
struct ricb { struct ricb {
u8 base_cq; u8 base_cq;
...@@ -1335,7 +1335,7 @@ struct ricb { ...@@ -1335,7 +1335,7 @@ struct ricb {
u8 hash_cq_id[1024]; u8 hash_cq_id[1024];
__le32 ipv6_hash_key[10]; __le32 ipv6_hash_key[10];
__le32 ipv4_hash_key[4]; __le32 ipv4_hash_key[4];
} __attribute((packed)); } __packed;
/* SOFTWARE/DRIVER DATA STRUCTURES. */ /* SOFTWARE/DRIVER DATA STRUCTURES. */
......
...@@ -38,7 +38,7 @@ struct efx_loopback_payload { ...@@ -38,7 +38,7 @@ struct efx_loopback_payload {
struct udphdr udp; struct udphdr udp;
__be16 iteration; __be16 iteration;
const char msg[64]; const char msg[64];
} __attribute__ ((packed)); } __packed;
/* Loopback test source MAC address */ /* Loopback test source MAC address */
static const unsigned char payload_source[ETH_ALEN] = { static const unsigned char payload_source[ETH_ALEN] = {
......
...@@ -2161,21 +2161,21 @@ struct sky2_tx_le { ...@@ -2161,21 +2161,21 @@ struct sky2_tx_le {
__le16 length; /* also vlan tag or checksum start */ __le16 length; /* also vlan tag or checksum start */
u8 ctrl; u8 ctrl;
u8 opcode; u8 opcode;
} __attribute((packed)); } __packed;
struct sky2_rx_le { struct sky2_rx_le {
__le32 addr; __le32 addr;
__le16 length; __le16 length;
u8 ctrl; u8 ctrl;
u8 opcode; u8 opcode;
} __attribute((packed)); } __packed;
struct sky2_status_le { struct sky2_status_le {
__le32 status; /* also checksum */ __le32 status; /* also checksum */
__le16 length; /* also vlan tag */ __le16 length; /* also vlan tag */
u8 css; u8 css;
u8 opcode; u8 opcode;
} __attribute((packed)); } __packed;
struct tx_ring_info { struct tx_ring_info {
struct sk_buff *skb; struct sk_buff *skb;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment