Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 50d585f788792c2344cf3b60dad947ac4223aee4
- Author: Arnd Bergmann <[email protected]>
- Date: Mon Jun 19 11:32:24 2023 +0200
- struct packing
- Signed-off-by: Arnd Bergmann <[email protected]>
- diff --git a/drivers/dma/dw-edma/dw-edma-v0-regs.h b/drivers/dma/dw-edma/dw-edma-v0-regs.h
- index e175f7b20480e..54800f9d9e460 100644
- --- a/drivers/dma/dw-edma/dw-edma-v0-regs.h
- +++ b/drivers/dma/dw-edma/dw-edma-v0-regs.h
- @@ -29,41 +29,41 @@ struct dw_edma_v0_ch_regs {
- u32 ch_control2; /* 0x0004 */
- u32 transfer_size; /* 0x0008 */
- union {
- - u64 reg; /* 0x000c..0x0010 */
- + u64 reg __packed; /* 0x000c..0x0010 */
- struct {
- u32 lsb; /* 0x000c */
- u32 msb; /* 0x0010 */
- };
- } sar;
- union {
- - u64 reg; /* 0x0014..0x0018 */
- + u64 reg __packed; /* 0x0014..0x0018 */
- struct {
- u32 lsb; /* 0x0014 */
- u32 msb; /* 0x0018 */
- };
- } dar;
- union {
- - u64 reg; /* 0x001c..0x0020 */
- + u64 reg __packed; /* 0x001c..0x0020 */
- struct {
- u32 lsb; /* 0x001c */
- u32 msb; /* 0x0020 */
- };
- } llp;
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_ch {
- struct dw_edma_v0_ch_regs wr; /* 0x0200 */
- u32 padding_1[55]; /* 0x0224..0x02fc */
- struct dw_edma_v0_ch_regs rd; /* 0x0300 */
- u32 padding_2[55]; /* 0x0324..0x03fc */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_unroll {
- u32 padding_1; /* 0x00f8 */
- u32 wr_engine_chgroup; /* 0x0100 */
- u32 rd_engine_chgroup; /* 0x0104 */
- union {
- - u64 reg; /* 0x0108..0x010c */
- + u64 reg __packed; /* 0x0108..0x010c */
- struct {
- u32 lsb; /* 0x0108 */
- u32 msb; /* 0x010c */
- @@ -71,7 +71,7 @@ struct dw_edma_v0_unroll {
- } wr_engine_hshake_cnt;
- u32 padding_2[2]; /* 0x0110..0x0114 */
- union {
- - u64 reg; /* 0x0120..0x0124 */
- + u64 reg __packed; /* 0x0120..0x0124 */
- struct {
- u32 lsb; /* 0x0120 */
- u32 msb; /* 0x0124 */
- @@ -97,12 +97,12 @@ struct dw_edma_v0_unroll {
- u32 rd_ch7_pwr_en; /* 0x0184 */
- u32 padding_5[30]; /* 0x0188..0x01fc */
- struct dw_edma_v0_ch ch[EDMA_V0_MAX_NR_CH]; /* 0x0200..0x1120 */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_legacy {
- u32 viewport_sel; /* 0x00f8 */
- struct dw_edma_v0_ch_regs ch; /* 0x0100..0x0120 */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_regs {
- /* eDMA global registers */
- @@ -113,7 +113,7 @@ struct dw_edma_v0_regs {
- u32 wr_doorbell; /* 0x0010 */
- u32 padding_2; /* 0x0014 */
- union {
- - u64 reg; /* 0x0018..0x001c */
- + u64 reg __packed; /* 0x0018..0x001c */
- struct {
- u32 lsb; /* 0x0018 */
- u32 msb; /* 0x001c */
- @@ -124,7 +124,7 @@ struct dw_edma_v0_regs {
- u32 rd_doorbell; /* 0x0030 */
- u32 padding_4; /* 0x0034 */
- union {
- - u64 reg; /* 0x0038..0x003c */
- + u64 reg __packed; /* 0x0038..0x003c */
- struct {
- u32 lsb; /* 0x0038 */
- u32 msb; /* 0x003c */
- @@ -138,14 +138,14 @@ struct dw_edma_v0_regs {
- u32 wr_int_clear; /* 0x0058 */
- u32 wr_err_status; /* 0x005c */
- union {
- - u64 reg; /* 0x0060..0x0064 */
- + u64 reg __packed; /* 0x0060..0x0064 */
- struct {
- u32 lsb; /* 0x0060 */
- u32 msb; /* 0x0064 */
- };
- } wr_done_imwr;
- union {
- - u64 reg; /* 0x0068..0x006c */
- + u64 reg __packed; /* 0x0068..0x006c */
- struct {
- u32 lsb; /* 0x0068 */
- u32 msb; /* 0x006c */
- @@ -164,7 +164,7 @@ struct dw_edma_v0_regs {
- u32 rd_int_clear; /* 0x00ac */
- u32 padding_10; /* 0x00b0 */
- union {
- - u64 reg; /* 0x00b4..0x00b8 */
- + u64 reg __packed; /* 0x00b4..0x00b8 */
- struct {
- u32 lsb; /* 0x00b4 */
- u32 msb; /* 0x00b8 */
- @@ -174,14 +174,14 @@ struct dw_edma_v0_regs {
- u32 rd_linked_list_err_en; /* 0x00c4 */
- u32 padding_12; /* 0x00c8 */
- union {
- - u64 reg; /* 0x00cc..0x00d0 */
- + u64 reg __packed; /* 0x00cc..0x00d0 */
- struct {
- u32 lsb; /* 0x00cc */
- u32 msb; /* 0x00d0 */
- };
- } rd_done_imwr;
- union {
- - u64 reg; /* 0x00d4..0x00d8 */
- + u64 reg __packed; /* 0x00d4..0x00d8 */
- struct {
- u32 lsb; /* 0x00d4 */
- u32 msb; /* 0x00d8 */
- @@ -196,38 +196,38 @@ struct dw_edma_v0_regs {
- union dw_edma_v0_type {
- struct dw_edma_v0_legacy legacy; /* 0x00f8..0x0120 */
- struct dw_edma_v0_unroll unroll; /* 0x00f8..0x1120 */
- - } type;
- -} __packed;
- + } type __packed __aligned(4);
- +} __packed __aligned(4);
- struct dw_edma_v0_lli {
- u32 control;
- u32 transfer_size;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } sar;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } dar;
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_llp {
- u32 control;
- u32 reserved;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } llp;
- -} __packed;
- +} __packed __aligned(4);
- #endif /* _DW_EDMA_V0_REGS_H */
- diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c
- index 85700cec5eac6..da28b87b7ab8b 100644
- --- a/drivers/hid/hid-nvidia-shield.c
- +++ b/drivers/hid/hid-nvidia-shield.c
- @@ -63,7 +63,7 @@ static_assert(sizeof(enum thunderstrike_led_state) == 1);
- struct thunderstrike_hostcmd_board_info {
- __le16 revision;
- __le16 serial[7];
- -};
- +} __packed;
- struct thunderstrike_hostcmd_haptics {
- u8 motor_left;
- @@ -81,7 +81,7 @@ struct thunderstrike_hostcmd_resp_report {
- __le16 fw_version;
- enum thunderstrike_led_state led_state;
- u8 payload[30];
- - };
- + } __packed;
- } __packed;
- static_assert(sizeof(struct thunderstrike_hostcmd_resp_report) ==
- THUNDERSTRIKE_HOSTCMD_REPORT_SIZE);
- diff --git a/drivers/infiniband/core/mad_priv.h b/drivers/infiniband/core/mad_priv.h
- index 1b7445a6f6714..f2d607bb0b967 100644
- --- a/drivers/infiniband/core/mad_priv.h
- +++ b/drivers/infiniband/core/mad_priv.h
- @@ -73,14 +73,14 @@ struct ib_mad_private_header {
- struct ib_mad_recv_wc recv_wc;
- struct ib_wc wc;
- u64 mapping;
- -} __packed;
- +};
- struct ib_mad_private {
- struct ib_mad_private_header header;
- size_t mad_size;
- struct ib_grh grh;
- u8 mad[];
- -} __packed;
- +};
- struct ib_rmpp_segment {
- struct list_head list;
- diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
- index dee8c97ff0568..07e24ede7d1ce 100644
- --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
- +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
- @@ -270,7 +270,7 @@ struct iser_rx_desc {
- struct ib_sge rx_sg;
- struct ib_cqe cqe;
- char pad[ISER_RX_PAD_SIZE];
- -} __packed;
- +} __packed __aligned(4);
- /**
- * struct iser_login_desc - iSER login descriptor
- diff --git a/drivers/media/dvb-frontends/as102_fe_types.h b/drivers/media/dvb-frontends/as102_fe_types.h
- index 297f9520ebf9d..981e79e75db13 100644
- --- a/drivers/media/dvb-frontends/as102_fe_types.h
- +++ b/drivers/media/dvb-frontends/as102_fe_types.h
- @@ -174,6 +174,7 @@ struct as10x_register_addr {
- uint32_t addr;
- /* register mode access */
- uint8_t mode;
- -};
- + uint8_t __pad[3];
- +} __packed;
- #endif
- diff --git a/drivers/net/ethernet/3com/typhoon.h b/drivers/net/ethernet/3com/typhoon.h
- index 38e6dcab4e941..1ee8d1643e082 100644
- --- a/drivers/net/ethernet/3com/typhoon.h
- +++ b/drivers/net/ethernet/3com/typhoon.h
- @@ -171,7 +171,7 @@ struct tx_desc {
- __le32 addr;
- __le32 addrHi;
- } frag;
- - u64 tx_addr; /* opaque for hardware, for TX_DESC */
- + u64 tx_addr __packed; /* opaque for hardware, for TX_DESC */
- };
- __le32 processFlags;
- #define TYPHOON_TX_PF_NO_CRC cpu_to_le32(0x00000001)
- @@ -187,7 +187,7 @@ struct tx_desc {
- #define TYPHOON_TX_PF_VLAN_MASK cpu_to_le32(0x0ffff000)
- #define TYPHOON_TX_PF_INTERNAL cpu_to_le32(0xf0000000)
- #define TYPHOON_TX_PF_VLAN_TAG_SHIFT 12
- -} __packed;
- +} __packed __aligned(4);
- /* The TCP Segmentation offload option descriptor
- *
- diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
- index 961d0465b923f..0b6d1c704be1a 100644
- --- a/drivers/scsi/pm8001/pm8001_hwi.h
- +++ b/drivers/scsi/pm8001/pm8001_hwi.h
- @@ -402,10 +402,10 @@ struct smp_req {
- union {
- u8 smp_req[32];
- struct {
- - __le64 long_req_addr;/* sg dma address, LE */
- + __le64 long_req_addr __packed;/* sg dma address, LE */
- __le32 long_req_size;/* LE */
- u32 _r_a;
- - __le64 long_resp_addr;/* sg dma address, LE */
- + __le64 long_resp_addr __packed;/* sg dma address, LE */
- __le32 long_resp_size;/* LE */
- u32 _r_b;
- } long_smp_req;/* sequencer extension */
- diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
- index acf6e3005b842..f3cc469a18602 100644
- --- a/drivers/scsi/pm8001/pm80xx_hwi.h
- +++ b/drivers/scsi/pm8001/pm80xx_hwi.h
- @@ -639,10 +639,10 @@ struct smp_req {
- union {
- u8 smp_req[32];
- struct {
- - __le64 long_req_addr;/* sg dma address, LE */
- + __le64 long_req_addr __packed;/* sg dma address, LE */
- __le32 long_req_size;/* LE */
- u32 _r_a;
- - __le64 long_resp_addr;/* sg dma address, LE */
- + __le64 long_resp_addr __packed;/* sg dma address, LE */
- __le32 long_resp_size;/* LE */
- u32 _r_b;
- } long_smp_req;/* sequencer extension */
- diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
- index 37b56ce75f39d..1f2d14077f764 100644
- --- a/drivers/usb/typec/tipd/core.c
- +++ b/drivers/usb/typec/tipd/core.c
- @@ -56,8 +56,8 @@ enum {
- /* TPS_REG_RX_IDENTITY_SOP */
- struct tps6598x_rx_identity_reg {
- u8 status;
- - struct usb_pd_identity identity;
- -} __packed;
- + struct usb_pd_identity identity __packed;
- +};
- /* Standard Task return codes */
- #define TPS_TASK_TIMEOUT 1
- diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
- index ab721cf13a986..61a5dde1511fc 100644
- --- a/include/linux/platform_data/cros_ec_commands.h
- +++ b/include/linux/platform_data/cros_ec_commands.h
- @@ -2684,7 +2684,7 @@ struct ec_params_motion_sense {
- */
- int16_t hys_degree;
- } tablet_mode_threshold;
- - };
- + } __packed;
- } __ec_todo_packed;
- struct ec_response_motion_sense {
- diff --git a/include/linux/tpm.h b/include/linux/tpm.h
- index 6a1e8f1572551..d8bc599e0a679 100644
- --- a/include/linux/tpm.h
- +++ b/include/linux/tpm.h
- @@ -288,13 +288,13 @@ enum tpm_chip_flags {
- #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
- struct tpm_header {
- - __be16 tag;
- - __be32 length;
- + __be16 tag __packed;
- + __be32 length __packed;
- union {
- - __be32 ordinal;
- - __be32 return_code;
- + __be32 ordinal __packed;
- + __be32 return_code __packed;
- };
- -} __packed;
- +};
- /* A string buffer type for constructing TPM commands. This is based on the
- * ideas of string buffer code in security/keys/trusted.h but is heap based
- diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
- index c59fb79a42e86..09fb71f7375cf 100644
- --- a/include/linux/usb/pd.h
- +++ b/include/linux/usb/pd.h
- @@ -195,7 +195,7 @@ struct pd_chunked_ext_message_data {
- struct pd_message {
- __le16 header;
- union {
- - __le32 payload[PD_MAX_PAYLOAD];
- + __le32 payload[PD_MAX_PAYLOAD] __packed;
- struct pd_chunked_ext_message_data ext_msg;
- };
- } __packed;
- diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
- index 5c72d1864dd6c..796e5595a7c11 100644
- --- a/include/net/sctp/structs.h
- +++ b/include/net/sctp/structs.h
- @@ -341,7 +341,7 @@ struct sctp_signed_cookie {
- __u8 signature[SCTP_SECRET_SIZE];
- __u32 __pad; /* force sctp_cookie alignment to 64 bits */
- struct sctp_cookie c;
- -} __packed;
- +} __aligned(__alignof__(struct sctp_cookie));
- /* This is another convenience type to allocate memory for address
- * params for the maximum size and pass such structures around
- diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
- index 1e7774ac808f0..905b4146426b7 100644
- --- a/include/rdma/ib_verbs.h
- +++ b/include/rdma/ib_verbs.h
- @@ -1366,7 +1366,7 @@ enum ib_send_flags {
- };
- struct ib_sge {
- - u64 addr;
- + u64 addr __packed;
- u32 length;
- u32 lkey;
- };
- diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h
- index 9b1f0f424a793..5410c55799606 100644
- --- a/include/scsi/scsi_bsg_iscsi.h
- +++ b/include/scsi/scsi_bsg_iscsi.h
- @@ -53,7 +53,7 @@ struct iscsi_bsg_host_vendor {
- /* start of vendor command area */
- uint32_t vendor_cmd[];
- -};
- +} __packed;
- /* Response:
- */
- diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h
- index 7e0983b987c2d..1cb79399f7b5c 100644
- --- a/include/uapi/linux/dvb/frontend.h
- +++ b/include/uapi/linux/dvb/frontend.h
- @@ -854,8 +854,8 @@ struct dtv_stats {
- union {
- __u64 uvalue; /* for counters and relative scales */
- __s64 svalue; /* for 0.001 dB measures */
- - };
- -} __attribute__ ((packed));
- + } __packed;
- +};
- #define MAX_DTV_STATS 4
- diff --git a/include/uapi/linux/if_pppol2tp.h b/include/uapi/linux/if_pppol2tp.h
- index a91044328bc90..d5bbe250971a3 100644
- --- a/include/uapi/linux/if_pppol2tp.h
- +++ b/include/uapi/linux/if_pppol2tp.h
- @@ -33,7 +33,7 @@ struct pppol2tp_addr {
- __u16 s_tunnel, s_session; /* For matching incoming packets */
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- -};
- +} __packed;
- /* Structure used to connect() the socket to a particular tunnel UDP
- * socket over IPv6.
- @@ -47,7 +47,7 @@ struct pppol2tpin6_addr {
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- struct sockaddr_in6 addr; /* IP address and port to send to */
- -};
- +} __packed;
- /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
- * bits. So we need a different sockaddr structure.
- @@ -61,7 +61,7 @@ struct pppol2tpv3_addr {
- __u32 s_tunnel, s_session; /* For matching incoming packets */
- __u32 d_tunnel, d_session; /* For sending outgoing packets */
- -};
- +} __packed;
- struct pppol2tpv3in6_addr {
- __kernel_pid_t pid; /* pid that owns the fd.
- @@ -72,7 +72,7 @@ struct pppol2tpv3in6_addr {
- __u32 d_tunnel, d_session; /* For sending outgoing packets */
- struct sockaddr_in6 addr; /* IP address and port to send to */
- -};
- +} __packed;
- /* Socket options:
- * DEBUG - bitmask of debug message categories (not used)
- diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
- index 9abd80dcc46f9..23a8391391d14 100644
- --- a/include/uapi/linux/if_pppox.h
- +++ b/include/uapi/linux/if_pppox.h
- @@ -66,8 +66,8 @@ struct sockaddr_pppox {
- __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
- unsigned int sa_protocol; /* protocol identifier */
- union {
- - struct pppoe_addr pppoe;
- - struct pptp_addr pptp;
- + struct pppoe_addr pppoe __packed;
- + struct pptp_addr pptp __packed;
- } sa_addr;
- } __packed;
- diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
- index ac56605fe9bca..fa1bc4dff17fc 100644
- --- a/include/uapi/linux/ipv6.h
- +++ b/include/uapi/linux/ipv6.h
- @@ -105,8 +105,8 @@ struct rt2_hdr {
- struct ipv6_destopt_hao {
- __u8 type;
- __u8 length;
- - struct in6_addr addr;
- -} __attribute__((packed));
- + struct in6_addr addr __packed;
- +};
- /*
- * IPv6 fixed header
- diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
- index c21edb966c196..4f999cb5c28ea 100644
- --- a/include/uapi/linux/rds.h
- +++ b/include/uapi/linux/rds.h
- @@ -212,7 +212,7 @@ struct rds6_info_socket {
- __be16 connected_port;
- __u32 rcvbuf;
- __u64 inum;
- -} __attribute__((packed));
- +} __attribute__((packed)) __attribute__((aligned(4)));
- struct rds_info_tcp_socket {
- __be32 local_addr;
- @@ -227,17 +227,27 @@ struct rds_info_tcp_socket {
- __u8 tos;
- } __attribute__((packed));
- +struct unaligned_in6_addr {
- + union {
- + __u8 u6_addr8[16];
- +#if __UAPI_DEF_IN6_ADDR_ALT
- + __be16 u6_addr16[8] __attribute__((packed));
- + __be32 u6_addr32[4] __attribute__((packed));
- +#endif
- + } in6_u;
- +};
- +
- struct rds6_info_tcp_socket {
- struct in6_addr local_addr;
- __be16 local_port;
- - struct in6_addr peer_addr;
- + struct unaligned_in6_addr peer_addr;
- __be16 peer_port;
- __u64 hdr_rem;
- __u64 data_rem;
- __u32 last_sent_nxt;
- __u32 last_expected_una;
- __u32 last_seen_una;
- -} __attribute__((packed));
- +} __attribute__((packed)) __attribute__((aligned(4)));
- #define RDS_IB_GID_LEN 16
- struct rds_info_rdma_connection {
- diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
- index cef7534d2d19b..47e1043e77509 100644
- --- a/include/uapi/linux/uhid.h
- +++ b/include/uapi/linux/uhid.h
- @@ -194,7 +194,7 @@ struct uhid_event {
- struct uhid_set_report_req set_report;
- struct uhid_set_report_reply_req set_report_reply;
- struct uhid_start_req start;
- - } u;
- + } __packed u;
- } __attribute__((__packed__));
- #endif /* __UHID_H_ */
- diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h
- index d77ee6b65328e..2329bbd6bc130 100644
- --- a/include/uapi/linux/usb/functionfs.h
- +++ b/include/uapi/linux/usb/functionfs.h
- @@ -67,7 +67,7 @@ struct usb_os_desc_header {
- __u8 Reserved;
- };
- __le16 wCount;
- - };
- + } __packed;
- } __attribute__((packed));
- struct usb_ext_compat_desc {
- diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
- index 3af6a82d0cade..96dffc1f52fc9 100644
- --- a/include/uapi/linux/videodev2.h
- +++ b/include/uapi/linux/videodev2.h
- @@ -1835,7 +1835,7 @@ struct v4l2_ext_control {
- struct v4l2_ctrl_av1_frame __user *p_av1_frame;
- struct v4l2_ctrl_av1_film_grain __user *p_av1_film_grain;
- void __user *ptr;
- - };
- + } __packed;
- } __attribute__ ((packed));
- struct v4l2_ext_controls {
- diff --git a/include/uapi/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h
- index 5e46cf1054af4..3f402fc48d12e 100644
- --- a/include/uapi/scsi/scsi_bsg_fc.h
- +++ b/include/uapi/scsi/scsi_bsg_fc.h
- @@ -188,7 +188,7 @@ struct fc_bsg_host_ct {commit 50d585f788792c2344cf3b60dad947ac4223aee4
- Author: Arnd Bergmann <[email protected]>
- Date: Mon Jun 19 11:32:24 2023 +0200
- struct packing
- Signed-off-by: Arnd Bergmann <[email protected]>
- diff --git a/drivers/dma/dw-edma/dw-edma-v0-regs.h b/drivers/dma/dw-edma/dw-edma-v0-regs.h
- index e175f7b20480e..54800f9d9e460 100644
- --- a/drivers/dma/dw-edma/dw-edma-v0-regs.h
- +++ b/drivers/dma/dw-edma/dw-edma-v0-regs.h
- @@ -29,41 +29,41 @@ struct dw_edma_v0_ch_regs {
- u32 ch_control2; /* 0x0004 */
- u32 transfer_size; /* 0x0008 */
- union {
- - u64 reg; /* 0x000c..0x0010 */
- + u64 reg __packed; /* 0x000c..0x0010 */
- struct {
- u32 lsb; /* 0x000c */
- u32 msb; /* 0x0010 */
- };
- } sar;
- union {
- - u64 reg; /* 0x0014..0x0018 */
- + u64 reg __packed; /* 0x0014..0x0018 */
- struct {
- u32 lsb; /* 0x0014 */
- u32 msb; /* 0x0018 */
- };
- } dar;
- union {
- - u64 reg; /* 0x001c..0x0020 */
- + u64 reg __packed; /* 0x001c..0x0020 */
- struct {
- u32 lsb; /* 0x001c */
- u32 msb; /* 0x0020 */
- };
- } llp;
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_ch {
- struct dw_edma_v0_ch_regs wr; /* 0x0200 */
- u32 padding_1[55]; /* 0x0224..0x02fc */
- struct dw_edma_v0_ch_regs rd; /* 0x0300 */
- u32 padding_2[55]; /* 0x0324..0x03fc */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_unroll {
- u32 padding_1; /* 0x00f8 */
- u32 wr_engine_chgroup; /* 0x0100 */
- u32 rd_engine_chgroup; /* 0x0104 */
- union {
- - u64 reg; /* 0x0108..0x010c */
- + u64 reg __packed; /* 0x0108..0x010c */
- struct {
- u32 lsb; /* 0x0108 */
- u32 msb; /* 0x010c */
- @@ -71,7 +71,7 @@ struct dw_edma_v0_unroll {
- } wr_engine_hshake_cnt;
- u32 padding_2[2]; /* 0x0110..0x0114 */
- union {
- - u64 reg; /* 0x0120..0x0124 */
- + u64 reg __packed; /* 0x0120..0x0124 */
- struct {
- u32 lsb; /* 0x0120 */
- u32 msb; /* 0x0124 */
- @@ -97,12 +97,12 @@ struct dw_edma_v0_unroll {
- u32 rd_ch7_pwr_en; /* 0x0184 */
- u32 padding_5[30]; /* 0x0188..0x01fc */
- struct dw_edma_v0_ch ch[EDMA_V0_MAX_NR_CH]; /* 0x0200..0x1120 */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_legacy {
- u32 viewport_sel; /* 0x00f8 */
- struct dw_edma_v0_ch_regs ch; /* 0x0100..0x0120 */
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_regs {
- /* eDMA global registers */
- @@ -113,7 +113,7 @@ struct dw_edma_v0_regs {
- u32 wr_doorbell; /* 0x0010 */
- u32 padding_2; /* 0x0014 */
- union {
- - u64 reg; /* 0x0018..0x001c */
- + u64 reg __packed; /* 0x0018..0x001c */
- struct {
- u32 lsb; /* 0x0018 */
- u32 msb; /* 0x001c */
- @@ -124,7 +124,7 @@ struct dw_edma_v0_regs {
- u32 rd_doorbell; /* 0x0030 */
- u32 padding_4; /* 0x0034 */
- union {
- - u64 reg; /* 0x0038..0x003c */
- + u64 reg __packed; /* 0x0038..0x003c */
- struct {
- u32 lsb; /* 0x0038 */
- u32 msb; /* 0x003c */
- @@ -138,14 +138,14 @@ struct dw_edma_v0_regs {
- u32 wr_int_clear; /* 0x0058 */
- u32 wr_err_status; /* 0x005c */
- union {
- - u64 reg; /* 0x0060..0x0064 */
- + u64 reg __packed; /* 0x0060..0x0064 */
- struct {
- u32 lsb; /* 0x0060 */
- u32 msb; /* 0x0064 */
- };
- } wr_done_imwr;
- union {
- - u64 reg; /* 0x0068..0x006c */
- + u64 reg __packed; /* 0x0068..0x006c */
- struct {
- u32 lsb; /* 0x0068 */
- u32 msb; /* 0x006c */
- @@ -164,7 +164,7 @@ struct dw_edma_v0_regs {
- u32 rd_int_clear; /* 0x00ac */
- u32 padding_10; /* 0x00b0 */
- union {
- - u64 reg; /* 0x00b4..0x00b8 */
- + u64 reg __packed; /* 0x00b4..0x00b8 */
- struct {
- u32 lsb; /* 0x00b4 */
- u32 msb; /* 0x00b8 */
- @@ -174,14 +174,14 @@ struct dw_edma_v0_regs {
- u32 rd_linked_list_err_en; /* 0x00c4 */
- u32 padding_12; /* 0x00c8 */
- union {
- - u64 reg; /* 0x00cc..0x00d0 */
- + u64 reg __packed; /* 0x00cc..0x00d0 */
- struct {
- u32 lsb; /* 0x00cc */
- u32 msb; /* 0x00d0 */
- };
- } rd_done_imwr;
- union {
- - u64 reg; /* 0x00d4..0x00d8 */
- + u64 reg __packed; /* 0x00d4..0x00d8 */
- struct {
- u32 lsb; /* 0x00d4 */
- u32 msb; /* 0x00d8 */
- @@ -196,38 +196,38 @@ struct dw_edma_v0_regs {
- union dw_edma_v0_type {
- struct dw_edma_v0_legacy legacy; /* 0x00f8..0x0120 */
- struct dw_edma_v0_unroll unroll; /* 0x00f8..0x1120 */
- - } type;
- -} __packed;
- + } type __packed __aligned(4);
- +} __packed __aligned(4);
- struct dw_edma_v0_lli {
- u32 control;
- u32 transfer_size;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } sar;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } dar;
- -} __packed;
- +} __packed __aligned(4);
- struct dw_edma_v0_llp {
- u32 control;
- u32 reserved;
- union {
- - u64 reg;
- + u64 reg __packed;
- struct {
- u32 lsb;
- u32 msb;
- };
- } llp;
- -} __packed;
- +} __packed __aligned(4);
- #endif /* _DW_EDMA_V0_REGS_H */
- diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c
- index 85700cec5eac6..da28b87b7ab8b 100644
- --- a/drivers/hid/hid-nvidia-shield.c
- +++ b/drivers/hid/hid-nvidia-shield.c
- @@ -63,7 +63,7 @@ static_assert(sizeof(enum thunderstrike_led_state) == 1);
- struct thunderstrike_hostcmd_board_info {
- __le16 revision;
- __le16 serial[7];
- -};
- +} __packed;
- struct thunderstrike_hostcmd_haptics {
- u8 motor_left;
- @@ -81,7 +81,7 @@ struct thunderstrike_hostcmd_resp_report {
- __le16 fw_version;
- enum thunderstrike_led_state led_state;
- u8 payload[30];
- - };
- + } __packed;
- } __packed;
- static_assert(sizeof(struct thunderstrike_hostcmd_resp_report) ==
- THUNDERSTRIKE_HOSTCMD_REPORT_SIZE);
- diff --git a/drivers/infiniband/core/mad_priv.h b/drivers/infiniband/core/mad_priv.h
- index 1b7445a6f6714..f2d607bb0b967 100644
- --- a/drivers/infiniband/core/mad_priv.h
- +++ b/drivers/infiniband/core/mad_priv.h
- @@ -73,14 +73,14 @@ struct ib_mad_private_header {
- struct ib_mad_recv_wc recv_wc;
- struct ib_wc wc;
- u64 mapping;
- -} __packed;
- +};
- struct ib_mad_private {
- struct ib_mad_private_header header;
- size_t mad_size;
- struct ib_grh grh;
- u8 mad[];
- -} __packed;
- +};
- struct ib_rmpp_segment {
- struct list_head list;
- diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
- index dee8c97ff0568..07e24ede7d1ce 100644
- --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
- +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
- @@ -270,7 +270,7 @@ struct iser_rx_desc {
- struct ib_sge rx_sg;
- struct ib_cqe cqe;
- char pad[ISER_RX_PAD_SIZE];
- -} __packed;
- +} __packed __aligned(4);
- /**
- * struct iser_login_desc - iSER login descriptor
- diff --git a/drivers/media/dvb-frontends/as102_fe_types.h b/drivers/media/dvb-frontends/as102_fe_types.h
- index 297f9520ebf9d..981e79e75db13 100644
- --- a/drivers/media/dvb-frontends/as102_fe_types.h
- +++ b/drivers/media/dvb-frontends/as102_fe_types.h
- @@ -174,6 +174,7 @@ struct as10x_register_addr {
- uint32_t addr;
- /* register mode access */
- uint8_t mode;
- -};
- + uint8_t __pad[3];
- +} __packed;
- #endif
- diff --git a/drivers/net/ethernet/3com/typhoon.h b/drivers/net/ethernet/3com/typhoon.h
- index 38e6dcab4e941..1ee8d1643e082 100644
- --- a/drivers/net/ethernet/3com/typhoon.h
- +++ b/drivers/net/ethernet/3com/typhoon.h
- @@ -171,7 +171,7 @@ struct tx_desc {
- __le32 addr;
- __le32 addrHi;
- } frag;
- - u64 tx_addr; /* opaque for hardware, for TX_DESC */
- + u64 tx_addr __packed; /* opaque for hardware, for TX_DESC */
- };
- __le32 processFlags;
- #define TYPHOON_TX_PF_NO_CRC cpu_to_le32(0x00000001)
- @@ -187,7 +187,7 @@ struct tx_desc {
- #define TYPHOON_TX_PF_VLAN_MASK cpu_to_le32(0x0ffff000)
- #define TYPHOON_TX_PF_INTERNAL cpu_to_le32(0xf0000000)
- #define TYPHOON_TX_PF_VLAN_TAG_SHIFT 12
- -} __packed;
- +} __packed __aligned(4);
- /* The TCP Segmentation offload option descriptor
- *
- diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
- index 961d0465b923f..0b6d1c704be1a 100644
- --- a/drivers/scsi/pm8001/pm8001_hwi.h
- +++ b/drivers/scsi/pm8001/pm8001_hwi.h
- @@ -402,10 +402,10 @@ struct smp_req {
- union {
- u8 smp_req[32];
- struct {
- - __le64 long_req_addr;/* sg dma address, LE */
- + __le64 long_req_addr __packed;/* sg dma address, LE */
- __le32 long_req_size;/* LE */
- u32 _r_a;
- - __le64 long_resp_addr;/* sg dma address, LE */
- + __le64 long_resp_addr __packed;/* sg dma address, LE */
- __le32 long_resp_size;/* LE */
- u32 _r_b;
- } long_smp_req;/* sequencer extension */
- diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
- index acf6e3005b842..f3cc469a18602 100644
- --- a/drivers/scsi/pm8001/pm80xx_hwi.h
- +++ b/drivers/scsi/pm8001/pm80xx_hwi.h
- @@ -639,10 +639,10 @@ struct smp_req {
- union {
- u8 smp_req[32];
- struct {
- - __le64 long_req_addr;/* sg dma address, LE */
- + __le64 long_req_addr __packed;/* sg dma address, LE */
- __le32 long_req_size;/* LE */
- u32 _r_a;
- - __le64 long_resp_addr;/* sg dma address, LE */
- + __le64 long_resp_addr __packed;/* sg dma address, LE */
- __le32 long_resp_size;/* LE */
- u32 _r_b;
- } long_smp_req;/* sequencer extension */
- diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
- index 37b56ce75f39d..1f2d14077f764 100644
- --- a/drivers/usb/typec/tipd/core.c
- +++ b/drivers/usb/typec/tipd/core.c
- @@ -56,8 +56,8 @@ enum {
- /* TPS_REG_RX_IDENTITY_SOP */
- struct tps6598x_rx_identity_reg {
- u8 status;
- - struct usb_pd_identity identity;
- -} __packed;
- + struct usb_pd_identity identity __packed;
- +};
- /* Standard Task return codes */
- #define TPS_TASK_TIMEOUT 1
- diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h
- index ab721cf13a986..61a5dde1511fc 100644
- --- a/include/linux/platform_data/cros_ec_commands.h
- +++ b/include/linux/platform_data/cros_ec_commands.h
- @@ -2684,7 +2684,7 @@ struct ec_params_motion_sense {
- */
- int16_t hys_degree;
- } tablet_mode_threshold;
- - };
- + } __packed;
- } __ec_todo_packed;
- struct ec_response_motion_sense {
- diff --git a/include/linux/tpm.h b/include/linux/tpm.h
- index 6a1e8f1572551..d8bc599e0a679 100644
- --- a/include/linux/tpm.h
- +++ b/include/linux/tpm.h
- @@ -288,13 +288,13 @@ enum tpm_chip_flags {
- #define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
- struct tpm_header {
- - __be16 tag;
- - __be32 length;
- + __be16 tag __packed;
- + __be32 length __packed;
- union {
- - __be32 ordinal;
- - __be32 return_code;
- + __be32 ordinal __packed;
- + __be32 return_code __packed;
- };
- -} __packed;
- +};
- /* A string buffer type for constructing TPM commands. This is based on the
- * ideas of string buffer code in security/keys/trusted.h but is heap based
- diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
- index c59fb79a42e86..09fb71f7375cf 100644
- --- a/include/linux/usb/pd.h
- +++ b/include/linux/usb/pd.h
- @@ -195,7 +195,7 @@ struct pd_chunked_ext_message_data {
- struct pd_message {
- __le16 header;
- union {
- - __le32 payload[PD_MAX_PAYLOAD];
- + __le32 payload[PD_MAX_PAYLOAD] __packed;
- struct pd_chunked_ext_message_data ext_msg;
- };
- } __packed;
- diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
- index 5c72d1864dd6c..796e5595a7c11 100644
- --- a/include/net/sctp/structs.h
- +++ b/include/net/sctp/structs.h
- @@ -341,7 +341,7 @@ struct sctp_signed_cookie {
- __u8 signature[SCTP_SECRET_SIZE];
- __u32 __pad; /* force sctp_cookie alignment to 64 bits */
- struct sctp_cookie c;
- -} __packed;
- +} __aligned(__alignof__(struct sctp_cookie));
- /* This is another convenience type to allocate memory for address
- * params for the maximum size and pass such structures around
- diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
- index 1e7774ac808f0..905b4146426b7 100644
- --- a/include/rdma/ib_verbs.h
- +++ b/include/rdma/ib_verbs.h
- @@ -1366,7 +1366,7 @@ enum ib_send_flags {
- };
- struct ib_sge {
- - u64 addr;
- + u64 addr __packed;
- u32 length;
- u32 lkey;
- };
- diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h
- index 9b1f0f424a793..5410c55799606 100644
- --- a/include/scsi/scsi_bsg_iscsi.h
- +++ b/include/scsi/scsi_bsg_iscsi.h
- @@ -53,7 +53,7 @@ struct iscsi_bsg_host_vendor {
- /* start of vendor command area */
- uint32_t vendor_cmd[];
- -};
- +} __packed;
- /* Response:
- */
- diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h
- index 7e0983b987c2d..1cb79399f7b5c 100644
- --- a/include/uapi/linux/dvb/frontend.h
- +++ b/include/uapi/linux/dvb/frontend.h
- @@ -854,8 +854,8 @@ struct dtv_stats {
- union {
- __u64 uvalue; /* for counters and relative scales */
- __s64 svalue; /* for 0.001 dB measures */
- - };
- -} __attribute__ ((packed));
- + } __packed;
- +};
- #define MAX_DTV_STATS 4
- diff --git a/include/uapi/linux/if_pppol2tp.h b/include/uapi/linux/if_pppol2tp.h
- index a91044328bc90..d5bbe250971a3 100644
- --- a/include/uapi/linux/if_pppol2tp.h
- +++ b/include/uapi/linux/if_pppol2tp.h
- @@ -33,7 +33,7 @@ struct pppol2tp_addr {
- __u16 s_tunnel, s_session; /* For matching incoming packets */
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- -};
- +} __packed;
- /* Structure used to connect() the socket to a particular tunnel UDP
- * socket over IPv6.
- @@ -47,7 +47,7 @@ struct pppol2tpin6_addr {
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- struct sockaddr_in6 addr; /* IP address and port to send to */
- -};
- +} __packed;
- /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
- * bits. So we need a different sockaddr structure.
- @@ -61,7 +61,7 @@ struct pppol2tpv3_addr {
- __u32 s_tunnel, s_session; /* For matching incoming packets */
- __u32 d_tunnel, d_session; /* For sending outgoing packets */
- -};
- +} __packed;
- struct pppol2tpv3in6_addr {
- __kernel_pid_t pid; /* pid that owns the fd.
- @@ -72,7 +72,7 @@ struct pppol2tpv3in6_addr {
- __u32 d_tunnel, d_session; /* For sending outgoing packets */
- struct sockaddr_in6 addr; /* IP address and port to send to */
- -};
- +} __packed;
- /* Socket options:
- * DEBUG - bitmask of debug message categories (not used)
- diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
- index 9abd80dcc46f9..23a8391391d14 100644
- --- a/include/uapi/linux/if_pppox.h
- +++ b/include/uapi/linux/if_pppox.h
- @@ -66,8 +66,8 @@ struct sockaddr_pppox {
- __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
- unsigned int sa_protocol; /* protocol identifier */
- union {
- - struct pppoe_addr pppoe;
- - struct pptp_addr pptp;
- + struct pppoe_addr pppoe __packed;
- + struct pptp_addr pptp __packed;
- } sa_addr;
- } __packed;
- diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
- index ac56605fe9bca..fa1bc4dff17fc 100644
- --- a/include/uapi/linux/ipv6.h
- +++ b/include/uapi/linux/ipv6.h
- @@ -105,8 +105,8 @@ struct rt2_hdr {
- struct ipv6_destopt_hao {
- __u8 type;
- __u8 length;
- - struct in6_addr addr;
- -} __attribute__((packed));
- + struct in6_addr addr __packed;
- +};
- /*
- * IPv6 fixed header
- diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h
- index c21edb966c196..4f999cb5c28ea 100644
- --- a/include/uapi/linux/rds.h
- +++ b/include/uapi/linux/rds.h
- @@ -212,7 +212,7 @@ struct rds6_info_socket {
- __be16 connected_port;
- __u32 rcvbuf;
- __u64 inum;
- -} __attribute__((packed));
- +} __attribute__((packed)) __attribute__((aligned(4)));
- struct rds_info_tcp_socket {
- __be32 local_addr;
- @@ -227,17 +227,27 @@ struct rds_info_tcp_socket {
- __u8 tos;
- } __attribute__((packed));
- +struct unaligned_in6_addr {
- + union {
- + __u8 u6_addr8[16];
- +#if __UAPI_DEF_IN6_ADDR_ALT
- + __be16 u6_addr16[8] __attribute__((packed));
- + __be32 u6_addr32[4] __attribute__((packed));
- +#endif
- + } in6_u;
- +};
- +
- struct rds6_info_tcp_socket {
- struct in6_addr local_addr;
- __be16 local_port;
- - struct in6_addr peer_addr;
- + struct unaligned_in6_addr peer_addr;
- __be16 peer_port;
- __u64 hdr_rem;
- __u64 data_rem;
- __u32 last_sent_nxt;
- __u32 last_expected_una;
- __u32 last_seen_una;
- -} __attribute__((packed));
- +} __attribute__((packed)) __attribute__((aligned(4)));
- #define RDS_IB_GID_LEN 16
- struct rds_info_rdma_connection {
- diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
- index cef7534d2d19b..47e1043e77509 100644
- --- a/include/uapi/linux/uhid.h
- +++ b/include/uapi/linux/uhid.h
- @@ -194,7 +194,7 @@ struct uhid_event {
- struct uhid_set_report_req set_report;
- struct uhid_set_report_reply_req set_report_reply;
- struct uhid_start_req start;
- - } u;
- + } __packed u;
- } __attribute__((__packed__));
- #endif /* __UHID_H_ */
- diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h
- index d77ee6b65328e..2329bbd6bc130 100644
- --- a/include/uapi/linux/usb/functionfs.h
- +++ b/include/uapi/linux/usb/functionfs.h
- @@ -67,7 +67,7 @@ struct usb_os_desc_header {
- __u8 Reserved;
- };
- __le16 wCount;
- - };
- + } __packed;
- } __attribute__((packed));
- struct usb_ext_compat_desc {
- diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
- index 3af6a82d0cade..96dffc1f52fc9 100644
- --- a/include/uapi/linux/videodev2.h
- +++ b/include/uapi/linux/videodev2.h
- @@ -1835,7 +1835,7 @@ struct v4l2_ext_control {
- struct v4l2_ctrl_av1_frame __user *p_av1_frame;
- struct v4l2_ctrl_av1_film_grain __user *p_av1_film_grain;
- void __user *ptr;
- - };
- + } __packed;
- } __attribute__ ((packed));
- struct v4l2_ext_controls {
- diff --git a/include/uapi/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h
- index 5e46cf1054af4..3f402fc48d12e 100644
- --- a/include/uapi/scsi/scsi_bsg_fc.h
- +++ b/include/uapi/scsi/scsi_bsg_fc.h
- @@ -188,7 +188,7 @@ struct fc_bsg_host_ct {
- __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
- __u32 preamble_word2; /* Cmd Code, Max Size */
- -};
- +} __packed;
- /* Response:
- *
- * The reply structure is an fc_bsg_ctels_reply structure
- @@ -210,7 +210,7 @@ struct fc_bsg_host_vendor {
- /* start of vendor command area */
- __u32 vendor_cmd[];
- -};
- +} __packed;
- /* Response:
- */
- @@ -256,7 +256,7 @@ struct fc_bsg_rport_ct {
- __u32 preamble_word0; /* revision & IN_ID */
- __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
- __u32 preamble_word2; /* Cmd Code, Max Size */
- -};
- +} __packed;
- /* Response:
- *
- * The reply structure is an fc_bsg_ctels_reply structure
- diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
- index 90f0b60b196ab..1c720c2093d91 100644
- --- a/net/smc/smc_llc.c
- +++ b/net/smc/smc_llc.c
- @@ -35,7 +35,7 @@ struct smc_llc_hdr {
- #endif
- };
- u16 length_v2; /* 44 - 8192*/
- - };
- + } __packed;
- u8 flags;
- } __packed; /* format defined in
- * IBM Shared Memory Communications Version 2
- diff --git a/sound/soc/codecs/mt6660.h b/sound/soc/codecs/mt6660.h
- index 054a3c56ec1fe..6c40b4065f24a 100644
- --- a/sound/soc/codecs/mt6660.h
- +++ b/sound/soc/codecs/mt6660.h
- @@ -9,7 +9,6 @@
- #include <linux/mutex.h>
- #include <linux/regmap.h>
- -#pragma pack(push, 1)
- struct mt6660_platform_data {
- u8 init_setting_num;
- u32 *init_setting_addr;
- @@ -26,7 +25,6 @@ struct mt6660_chip {
- struct regmap *regmap;
- u16 chip_rev;
- };
- -#pragma pack(pop)
- #define MT6660_REG_DEVID (0x00)
- #define MT6660_REG_SYSTEM_CTRL (0x03)
- __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
- __u32 preamble_word2; /* Cmd Code, Max Size */
- -};
- +} __packed;
- /* Response:
- *
- * The reply structure is an fc_bsg_ctels_reply structure
- @@ -210,7 +210,7 @@ struct fc_bsg_host_vendor {
- /* start of vendor command area */
- __u32 vendor_cmd[];
- -};
- +} __packed;
- /* Response:
- */
- @@ -256,7 +256,7 @@ struct fc_bsg_rport_ct {
- __u32 preamble_word0; /* revision & IN_ID */
- __u32 preamble_word1; /* GS_Type, GS_SubType, Options, Rsvd */
- __u32 preamble_word2; /* Cmd Code, Max Size */
- -};
- +} __packed;
- /* Response:
- *
- * The reply structure is an fc_bsg_ctels_reply structure
- diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
- index 90f0b60b196ab..1c720c2093d91 100644
- --- a/net/smc/smc_llc.c
- +++ b/net/smc/smc_llc.c
- @@ -35,7 +35,7 @@ struct smc_llc_hdr {
- #endif
- };
- u16 length_v2; /* 44 - 8192*/
- - };
- + } __packed;
- u8 flags;
- } __packed; /* format defined in
- * IBM Shared Memory Communications Version 2
- diff --git a/sound/soc/codecs/mt6660.h b/sound/soc/codecs/mt6660.h
- index 054a3c56ec1fe..6c40b4065f24a 100644
- --- a/sound/soc/codecs/mt6660.h
- +++ b/sound/soc/codecs/mt6660.h
- @@ -9,7 +9,6 @@
- #include <linux/mutex.h>
- #include <linux/regmap.h>
- -#pragma pack(push, 1)
- struct mt6660_platform_data {
- u8 init_setting_num;
- u32 *init_setting_addr;
- @@ -26,7 +25,6 @@ struct mt6660_chip {
- struct regmap *regmap;
- u16 chip_rev;
- };
- -#pragma pack(pop)
- #define MT6660_REG_DEVID (0x00)
- #define MT6660_REG_SYSTEM_CTRL (0x03)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement