Skip to content

Commit

Permalink
drivers/net: use __packed annotation
Browse files Browse the repository at this point in the history
cleanup patch.

Use new __packed annotation in drivers/net/

Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Jun 3, 2010
1 parent 1273d97 commit ba2d358
Show file tree
Hide file tree
Showing 113 changed files with 934 additions and 934 deletions.
6 changes: 3 additions & 3 deletions drivers/net/3c527.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct mc32_mailbox
{
u16 mbox;
u16 data[1];
} __attribute((packed));
} __packed;

struct skb_header
{
Expand All @@ -43,7 +43,7 @@ struct skb_header
u16 next; /* Do not change! */
u16 length;
u32 data;
} __attribute((packed));
} __packed;

struct mc32_stats
{
Expand All @@ -68,7 +68,7 @@ struct mc32_stats
u32 dataA[6];
u16 dataB[5];
u32 dataC[14];
} __attribute((packed));
} __packed;

#define STATUS_MASK 0x0F
#define COMPLETED (1<<7)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ struct cp_dma_stats {
__le32 rx_ok_mcast;
__le16 tx_abort;
__le16 tx_underrun;
} __attribute__((packed));
} __packed;

struct cp_extra_stats {
unsigned long rx_frags;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/atlx/atl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ struct rx_free_desc {
__le16 buf_len; /* Size of the receive buffer in host memory */
u16 coalese; /* Update consumer index to host after the
* reception of this frame */
/* __attribute__ ((packed)) is required */
} __attribute__ ((packed));
/* __packed is required */
} __packed;

/*
* The L1 transmit packet descriptor is comprised of four 32-bit words.
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/mscan/mscan.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ struct mscan_regs {
u16 time; /* + 0x7c 0x3e */
} tx;
_MSCAN_RESERVED_(32, 2); /* + 0x7e */
} __attribute__ ((packed));
} __packed;

#undef _MSCAN_RESERVED_
#define MSCAN_REGION sizeof(struct mscan)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/usb/ems_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ struct cpc_can_err_counter {
};

/* 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 length; /* length of data within union 'msg' */
u8 msgid; /* confirmation handle */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ struct dm9000_rxhdr {
u8 RxPktReady;
u8 RxStatus;
__le16 RxLen;
} __attribute__((__packed__));
} __packed;

/*
* Received a packet and pass to upper layer
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ehea/ehea_qmr.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct ehea_swqe {
u8 immediate_data[SWQE2_MAX_IMM];
/* 0xd0 */
struct ehea_vsgentry sg_list[EHEA_MAX_WQE_SG_ENTRIES-1];
} immdata_desc __attribute__ ((packed));
} immdata_desc __packed;

/* Send WQE Format 3 */
struct {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/enic/vnic_vic.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct vic_provinfo {
u16 length;
u8 value[0];
} tlv[0];
} __attribute__ ((packed));
} __packed;

#define VIC_PROVINFO_MAX_DATA 1385
#define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/fsl_pq_mdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct fsl_pq_mdio {
u8 reserved[28]; /* Space holder */
u32 utbipar; /* TBI phy address reg (only on UCC) */
u8 res4[2728];
} __attribute__ ((packed));
} __packed;

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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/donauboe.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ struct OboeSlot
__u8 control; /*Slot control/status see below */
__u32 address; /*Slot buffer address */
}
__attribute__ ((packed));
__packed;

#define OBOE_NTASKS OBOE_TXRING_OFFSET_IN_SLOTS

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/irda-usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct irda_class_desc {
__u8 bmAdditionalBOFs;
__u8 bIrdaRateSniff;
__u8 bMaxUnicastList;
} __attribute__ ((packed));
} __packed;

/* class specific interface request to get the IrDA-USB class descriptor
* (6.2.5, USB-IrDA class spec 1.0) */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/ks959-sir.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct ks959_speedparams {
__le32 baudrate; /* baud rate, little endian */
__u8 flags;
__u8 reserved[3];
} __attribute__ ((packed));
} __packed;

#define KS_DATA_5_BITS 0x00
#define KS_DATA_6_BITS 0x01
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/ksdazzle-sir.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct ksdazzle_speedparams {
__le32 baudrate; /* baud rate, little endian */
__u8 flags;
__u8 reserved[3];
} __attribute__ ((packed));
} __packed;

#define KS_DATA_5_BITS 0x00
#define KS_DATA_6_BITS 0x01
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/irda/vlsi_ir.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ struct ring_descr_hw {
struct {
u8 addr_res[3];
volatile u8 status; /* descriptor status */
} __attribute__((packed)) rd_s;
} __attribute((packed)) rd_u;
} __attribute__ ((packed));
} __packed rd_s;
} __packed rd_u;
} __packed;

#define rd_addr rd_u.addr
#define rd_status rd_u.rd_s.status
Expand Down
14 changes: 7 additions & 7 deletions drivers/net/mlx4/eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,35 +110,35 @@ struct mlx4_eqe {
u32 raw[6];
struct {
__be32 cqn;
} __attribute__((packed)) comp;
} __packed comp;
struct {
u16 reserved1;
__be16 token;
u32 reserved2;
u8 reserved3[3];
u8 status;
__be64 out_param;
} __attribute__((packed)) cmd;
} __packed cmd;
struct {
__be32 qpn;
} __attribute__((packed)) qp;
} __packed qp;
struct {
__be32 srqn;
} __attribute__((packed)) srq;
} __packed srq;
struct {
__be32 cqn;
u32 reserved1;
u8 reserved2[3];
u8 syndrome;
} __attribute__((packed)) cq_err;
} __packed cq_err;
struct {
u32 reserved1[2];
__be32 port;
} __attribute__((packed)) port_change;
} __packed port_change;
} event;
u8 reserved3[3];
u8 owner;
} __attribute__((packed));
} __packed;

static void eq_set_ci(struct mlx4_eq *eq, int req_not)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/mlx4/mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct mlx4_mpt_entry {
__be32 mtt_sz;
__be32 entity_size;
__be32 first_byte_offset;
} __attribute__((packed));
} __packed;

#define MLX4_MPT_FLAG_SW_OWNS (0xfUL << 28)
#define MLX4_MPT_FLAG_FREE (0x3UL << 28)
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/ps3_gelic_wireless.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct gelic_eurus_common_cfg {
u16 bss_type; /* infra or adhoc */
u16 auth_method; /* shared key or open */
u16 op_mode; /* B/G */
} __attribute__((packed));
} __packed;


/* for GELIC_EURUS_CMD_WEP_CFG */
Expand All @@ -88,7 +88,7 @@ struct gelic_eurus_wep_cfg {
/* all fields are big endian */
u16 security;
u8 key[4][16];
} __attribute__((packed));
} __packed;

/* for GELIC_EURUS_CMD_WPA_CFG */
enum gelic_eurus_wpa_security {
Expand Down Expand Up @@ -120,7 +120,7 @@ struct gelic_eurus_wpa_cfg {
u16 security;
u16 psk_type; /* psk key encoding type */
u8 psk[GELIC_WL_EURUS_PSK_MAX_LEN]; /* psk key; hex or passphrase */
} __attribute__((packed));
} __packed;

/* for GELIC_EURUS_CMD_{START,GET}_SCAN */
enum gelic_eurus_scan_capability {
Expand Down Expand Up @@ -171,7 +171,7 @@ struct gelic_eurus_scan_info {
__be32 reserved3;
__be32 reserved4;
u8 elements[0]; /* ie */
} __attribute__ ((packed));
} __packed;

/* the hypervisor returns bbs up to 16 */
#define GELIC_EURUS_MAX_SCAN (16)
Expand All @@ -193,7 +193,7 @@ struct gelic_wl_scan_info {
struct gelic_eurus_rssi_info {
/* big endian */
__be16 rssi;
} __attribute__ ((packed));
} __packed;


/* for 'stat' member of gelic_wl_info */
Expand Down
24 changes: 12 additions & 12 deletions drivers/net/qlge/qlge.h
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ struct tx_buf_desc {
#define TX_DESC_LEN_MASK 0x000fffff
#define TX_DESC_C 0x40000000
#define TX_DESC_E 0x80000000
} __attribute((packed));
} __packed;

/*
* IOCB Definitions...
Expand Down Expand Up @@ -1095,7 +1095,7 @@ struct ob_mac_iocb_req {
__le16 vlan_tci;
__le16 reserved4;
struct tx_buf_desc tbd[TX_DESC_PER_IOCB];
} __attribute((packed));
} __packed;

struct ob_mac_iocb_rsp {
u8 opcode; /* */
Expand All @@ -1112,7 +1112,7 @@ struct ob_mac_iocb_rsp {
u32 tid;
u32 txq_idx;
__le32 reserved[13];
} __attribute((packed));
} __packed;

struct ob_mac_tso_iocb_req {
u8 opcode;
Expand Down Expand Up @@ -1140,7 +1140,7 @@ struct ob_mac_tso_iocb_req {
__le16 vlan_tci;
__le16 mss;
struct tx_buf_desc tbd[TX_DESC_PER_IOCB];
} __attribute((packed));
} __packed;

struct ob_mac_tso_iocb_rsp {
u8 opcode;
Expand All @@ -1157,7 +1157,7 @@ struct ob_mac_tso_iocb_rsp {
u32 tid;
u32 txq_idx;
__le32 reserved2[13];
} __attribute((packed));
} __packed;

struct ib_mac_iocb_rsp {
u8 opcode; /* 0x20 */
Expand Down Expand Up @@ -1216,7 +1216,7 @@ struct ib_mac_iocb_rsp {
#define IB_MAC_IOCB_RSP_HL 0x80
__le32 hdr_len; /* */
__le64 hdr_addr; /* */
} __attribute((packed));
} __packed;

struct ib_ae_iocb_rsp {
u8 opcode;
Expand All @@ -1237,7 +1237,7 @@ struct ib_ae_iocb_rsp {
#define PCI_ERR_ANON_BUF_RD 0x40
u8 q_id;
__le32 reserved[15];
} __attribute((packed));
} __packed;

/*
* These three structures are for generic
Expand All @@ -1249,15 +1249,15 @@ struct ql_net_rsp_iocb {
__le16 length;
__le32 tid;
__le32 reserved[14];
} __attribute((packed));
} __packed;

struct net_req_iocb {
u8 opcode;
u8 flags0;
__le16 flags1;
__le32 tid;
__le32 reserved1[30];
} __attribute((packed));
} __packed;

/*
* tx ring initialization control block for chip.
Expand All @@ -1283,7 +1283,7 @@ struct wqicb {
__le16 rid;
__le64 addr;
__le64 cnsmr_idx_addr;
} __attribute((packed));
} __packed;

/*
* rx ring initialization control block for chip.
Expand Down Expand Up @@ -1317,7 +1317,7 @@ struct cqicb {
__le64 sbq_addr;
__le16 sbq_buf_size;
__le16 sbq_len; /* entry count */
} __attribute((packed));
} __packed;

struct ricb {
u8 base_cq;
Expand All @@ -1335,7 +1335,7 @@ struct ricb {
u8 hash_cq_id[1024];
__le32 ipv6_hash_key[10];
__le32 ipv4_hash_key[4];
} __attribute((packed));
} __packed;

/* SOFTWARE/DRIVER DATA STRUCTURES. */

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sfc/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct efx_loopback_payload {
struct udphdr udp;
__be16 iteration;
const char msg[64];
} __attribute__ ((packed));
} __packed;

/* Loopback test source MAC address */
static const unsigned char payload_source[ETH_ALEN] = {
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/sky2.h
Original file line number Diff line number Diff line change
Expand Up @@ -2161,21 +2161,21 @@ struct sky2_tx_le {
__le16 length; /* also vlan tag or checksum start */
u8 ctrl;
u8 opcode;
} __attribute((packed));
} __packed;

struct sky2_rx_le {
__le32 addr;
__le16 length;
u8 ctrl;
u8 opcode;
} __attribute((packed));
} __packed;

struct sky2_status_le {
__le32 status; /* also checksum */
__le16 length; /* also vlan tag */
u8 css;
u8 opcode;
} __attribute((packed));
} __packed;

struct tx_ring_info {
struct sk_buff *skb;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/tehuti.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ struct txd_desc {
u32 va_lo;
u32 va_hi;
struct pbl pbl[0]; /* Fragments */
} __attribute__ ((packed));
} __packed;

/* Register region size */
#define BDX_REGS_SIZE 0x1000
Expand Down
Loading

0 comments on commit ba2d358

Please sign in to comment.