Skip to content

Commit

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

Use new __packed annotation in net/ and include/
(except netfilter)

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 ba2d358 commit bc10502
Show file tree
Hide file tree
Showing 30 changed files with 133 additions and 133 deletions.
2 changes: 1 addition & 1 deletion include/linux/if_ether.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct ethhdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
__be16 h_proto; /* packet type ID field */
} __attribute__((packed));
} __packed;

#ifdef __KERNEL__
#include <linux/skbuff.h>
Expand Down
8 changes: 4 additions & 4 deletions include/linux/if_fddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ struct fddi_8022_1_hdr {
__u8 dsap; /* destination service access point */
__u8 ssap; /* source service access point */
__u8 ctrl; /* control byte #1 */
} __attribute__ ((packed));
} __packed;

/* Define 802.2 Type 2 header */
struct fddi_8022_2_hdr {
__u8 dsap; /* destination service access point */
__u8 ssap; /* source service access point */
__u8 ctrl_1; /* control byte #1 */
__u8 ctrl_2; /* control byte #2 */
} __attribute__ ((packed));
} __packed;

/* Define 802.2 SNAP header */
#define FDDI_K_OUI_LEN 3
Expand All @@ -85,7 +85,7 @@ struct fddi_snap_hdr {
__u8 ctrl; /* always 0x03 */
__u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */
__be16 ethertype; /* packet type ID field */
} __attribute__ ((packed));
} __packed;

/* Define FDDI LLC frame header */
struct fddihdr {
Expand All @@ -98,7 +98,7 @@ struct fddihdr {
struct fddi_8022_2_hdr llc_8022_2;
struct fddi_snap_hdr llc_snap;
} hdr;
} __attribute__ ((packed));
} __packed;

#ifdef __KERNEL__
#include <linux/netdevice.h>
Expand Down
2 changes: 1 addition & 1 deletion include/linux/if_frad.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct frhdr
__be16 PID;

#define IP_NLPID pad
} __attribute__((packed));
} __packed;

/* see RFC 1490 for the definition of the following */
#define FRAD_I_UI 0x03
Expand Down
8 changes: 4 additions & 4 deletions include/linux/if_hippi.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct hippi_fp_hdr {
__be32 fixed;
#endif
__be32 d2_size;
} __attribute__ ((packed));
} __packed;

struct hippi_le_hdr {
#if defined (__BIG_ENDIAN_BITFIELD)
Expand All @@ -129,7 +129,7 @@ struct hippi_le_hdr {
__u8 daddr[HIPPI_ALEN];
__u16 locally_administered;
__u8 saddr[HIPPI_ALEN];
} __attribute__ ((packed));
} __packed;

#define HIPPI_OUI_LEN 3
/*
Expand All @@ -142,12 +142,12 @@ struct hippi_snap_hdr {
__u8 ctrl; /* always 0x03 */
__u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/
__be16 ethertype; /* packet type ID field */
} __attribute__ ((packed));
} __packed;

struct hippi_hdr {
struct hippi_fp_hdr fp;
struct hippi_le_hdr le;
struct hippi_snap_hdr snap;
} __attribute__ ((packed));
} __packed;

#endif /* _LINUX_IF_HIPPI_H */
8 changes: 4 additions & 4 deletions include/linux/if_pppox.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct sockaddr_pppox {
union{
struct pppoe_addr pppoe;
}sa_addr;
}__attribute__ ((packed));
} __packed;

/* The use of the above union isn't viable because the size of this
* struct must stay fixed over time -- applications use sizeof(struct
Expand All @@ -70,7 +70,7 @@ struct sockaddr_pppol2tp {
sa_family_t sa_family; /* address family, AF_PPPOX */
unsigned int sa_protocol; /* protocol identifier */
struct pppol2tp_addr pppol2tp;
}__attribute__ ((packed));
} __packed;

/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
* bits. So we need a different sockaddr structure.
Expand All @@ -79,7 +79,7 @@ struct sockaddr_pppol2tpv3 {
sa_family_t sa_family; /* address family, AF_PPPOX */
unsigned int sa_protocol; /* protocol identifier */
struct pppol2tpv3_addr pppol2tp;
} __attribute__ ((packed));
} __packed;

/*********************************************************************
*
Expand Down Expand Up @@ -129,7 +129,7 @@ struct pppoe_hdr {
__be16 sid;
__be16 length;
struct pppoe_tag tag[0];
} __attribute__ ((packed));
} __packed;

/* Length of entire PPPoE + PPP header */
#define PPPOE_SES_HLEN 8
Expand Down
4 changes: 2 additions & 2 deletions include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct ipv6_opt_hdr {
/*
* TLV encoded option data follows.
*/
} __attribute__ ((packed)); /* required for some archs */
} __packed; /* required for some archs */

#define ipv6_destopt_hdr ipv6_opt_hdr
#define ipv6_hopopt_hdr ipv6_opt_hdr
Expand Down Expand Up @@ -99,7 +99,7 @@ struct ipv6_destopt_hao {
__u8 type;
__u8 length;
struct in6_addr addr;
} __attribute__ ((__packed__));
} __packed;

/*
* IPv6 fixed header
Expand Down
2 changes: 1 addition & 1 deletion include/linux/isdnif.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ typedef struct T30_s {
__u8 r_scantime;
__u8 r_id[FAXIDLEN];
__u8 r_code;
} __attribute__((packed)) T30_s;
} __packed T30_s;

#define ISDN_TTY_FAX_CONN_IN 0
#define ISDN_TTY_FAX_CONN_OUT 1
Expand Down
2 changes: 1 addition & 1 deletion include/linux/mISDNif.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
struct mISDNhead {
unsigned int prim;
unsigned int id;
} __attribute__((packed));
} __packed;

#define MISDN_HEADER_LEN sizeof(struct mISDNhead)
#define MAX_DATA_SIZE 2048
Expand Down
2 changes: 1 addition & 1 deletion include/linux/nbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct nbd_request {
char handle[8];
__be64 from;
__be32 len;
} __attribute__ ((packed));
} __packed;

/*
* This is the reply packet that nbd-server sends back to the client after
Expand Down
10 changes: 5 additions & 5 deletions include/linux/ncp.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct ncp_request_header {
__u8 conn_high;
__u8 function;
__u8 data[0];
} __attribute__((packed));
} __packed;

#define NCP_REPLY (0x3333)
#define NCP_WATCHDOG (0x3E3E)
Expand All @@ -42,7 +42,7 @@ struct ncp_reply_header {
__u8 completion_code;
__u8 connection_state;
__u8 data[0];
} __attribute__((packed));
} __packed;

#define NCP_VOLNAME_LEN (16)
#define NCP_NUMBER_OF_VOLUMES (256)
Expand Down Expand Up @@ -158,7 +158,7 @@ struct nw_info_struct {
#ifdef __KERNEL__
struct nw_nfs_info nfs;
#endif
} __attribute__((packed));
} __packed;

/* modify mask - use with MODIFY_DOS_INFO structure */
#define DM_ATTRIBUTES (cpu_to_le32(0x02))
Expand Down Expand Up @@ -190,12 +190,12 @@ struct nw_modify_dos_info {
__u16 inheritanceGrantMask;
__u16 inheritanceRevokeMask;
__u32 maximumSpace;
} __attribute__((packed));
} __packed;

struct nw_search_sequence {
__u8 volNumber;
__u32 dirBase;
__u32 sequence;
} __attribute__((packed));
} __packed;

#endif /* _LINUX_NCP_H */
14 changes: 7 additions & 7 deletions include/linux/ncp_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ struct ncp_server {

unsigned int state; /* STREAM only: receiver state */
struct {
__u32 magic __attribute__((packed));
__u32 len __attribute__((packed));
__u16 type __attribute__((packed));
__u16 p1 __attribute__((packed));
__u16 p2 __attribute__((packed));
__u16 p3 __attribute__((packed));
__u16 type2 __attribute__((packed));
__u32 magic __packed;
__u32 len __packed;
__u16 type __packed;
__u16 p1 __packed;
__u16 p2 __packed;
__u16 p3 __packed;
__u16 type2 __packed;
} buf; /* STREAM only: temporary buffer */
unsigned char* ptr; /* STREAM only: pointer to data */
size_t len; /* STREAM only: length of data to receive */
Expand Down
4 changes: 2 additions & 2 deletions include/linux/phonet.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct phonethdr {
__be16 pn_length;
__u8 pn_robj;
__u8 pn_sobj;
} __attribute__((packed));
} __packed;

/* Common Phonet payload header */
struct phonetmsg {
Expand Down Expand Up @@ -98,7 +98,7 @@ struct sockaddr_pn {
__u8 spn_dev;
__u8 spn_resource;
__u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
} __attribute__ ((packed));
} __packed;

/* Well known address */
#define PN_DEV_PC 0x10
Expand Down
12 changes: 6 additions & 6 deletions include/linux/rds.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
struct rds_info_counter {
u_int8_t name[32];
u_int64_t value;
} __attribute__((packed));
} __packed;

#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
Expand All @@ -115,15 +115,15 @@ struct rds_info_connection {
__be32 faddr;
u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */
u_int8_t flags;
} __attribute__((packed));
} __packed;

struct rds_info_flow {
__be32 laddr;
__be32 faddr;
u_int32_t bytes;
__be16 lport;
__be16 fport;
} __attribute__((packed));
} __packed;

#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
Expand All @@ -136,7 +136,7 @@ struct rds_info_message {
__be16 lport;
__be16 fport;
u_int8_t flags;
} __attribute__((packed));
} __packed;

struct rds_info_socket {
u_int32_t sndbuf;
Expand All @@ -146,7 +146,7 @@ struct rds_info_socket {
__be16 connected_port;
u_int32_t rcvbuf;
u_int64_t inum;
} __attribute__((packed));
} __packed;

struct rds_info_tcp_socket {
__be32 local_addr;
Expand All @@ -158,7 +158,7 @@ struct rds_info_tcp_socket {
u_int32_t last_sent_nxt;
u_int32_t last_expected_una;
u_int32_t last_seen_una;
} __attribute__((packed));
} __packed;

#define RDS_IB_GID_LEN 16
struct rds_info_rdma_connection {
Expand Down
Loading

0 comments on commit bc10502

Please sign in to comment.