Merge "Replace __packed with __attribute__((__packed__)) in uapi headers"

This commit is contained in:
Treehugger Robot 2022-12-17 01:49:22 +00:00 committed by Gerrit Code Review
commit 6f78f756a2
21 changed files with 76 additions and 73 deletions

View file

@ -94,6 +94,9 @@ kernel_token_replacements = {
"__kernel_old_timeval": "timeval",
# Do the same for __kernel_old_itimerval as for timeval.
"__kernel_old_itimerval": "itimerval",
# Replace __packed with __attribute__((__packed__)) to avoid depending
# on sys/cdefs.h
"__packed": "__attribute__((__packed__))",
}

View file

@ -788,7 +788,7 @@ struct i915_context_engines_parallel_submit {
__u64 flags;
__u64 mbz64[3];
struct i915_engine_class_instance engines[];
} __packed;
} __attribute__((__packed__));
#define I915_DEFINE_CONTEXT_ENGINES_PARALLEL_SUBMIT(name__,N__) struct { struct i915_user_extension base; __u16 engine_index; __u16 width; __u16 num_siblings; __u16 mbz16; __u64 flags; __u64 mbz64[3]; struct i915_engine_class_instance engines[N__]; \
} __attribute__((packed)) name__
struct i915_context_param_engines {

View file

@ -189,7 +189,7 @@ struct binder_ptr_cookie {
struct binder_handle_cookie {
__u32 handle;
binder_uintptr_t cookie;
} __packed;
} __attribute__((__packed__));
struct binder_pri_desc {
__s32 priority;
__u32 desc;

View file

@ -55,13 +55,13 @@ struct dns_payload_header {
__u8 zero;
__u8 content;
__u8 version;
} __packed;
} __attribute__((__packed__));
struct dns_server_list_v1_header {
struct dns_payload_header hdr;
__u8 source;
__u8 status;
__u8 nr_servers;
} __packed;
} __attribute__((__packed__));
struct dns_server_list_v1_server {
__u16 name_len;
__u16 priority;
@ -71,8 +71,8 @@ struct dns_server_list_v1_server {
__u8 status;
__u8 protocol;
__u8 nr_addrs;
} __packed;
} __attribute__((__packed__));
struct dns_server_list_v1_address {
__u8 address_type;
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -51,27 +51,27 @@ struct sockaddr_pppox {
struct pppoe_addr pppoe;
struct pptp_addr pptp;
} sa_addr;
} __packed;
} __attribute__((__packed__));
struct sockaddr_pppol2tp {
__kernel_sa_family_t sa_family;
unsigned int sa_protocol;
struct pppol2tp_addr pppol2tp;
} __packed;
} __attribute__((__packed__));
struct sockaddr_pppol2tpin6 {
__kernel_sa_family_t sa_family;
unsigned int sa_protocol;
struct pppol2tpin6_addr pppol2tp;
} __packed;
} __attribute__((__packed__));
struct sockaddr_pppol2tpv3 {
__kernel_sa_family_t sa_family;
unsigned int sa_protocol;
struct pppol2tpv3_addr pppol2tp;
} __packed;
} __attribute__((__packed__));
struct sockaddr_pppol2tpv3in6 {
__kernel_sa_family_t sa_family;
unsigned int sa_protocol;
struct pppol2tpv3in6_addr pppol2tp;
} __packed;
} __attribute__((__packed__));
#define PPPOEIOCSFWD _IOW(0xB1, 0, size_t)
#define PPPOEIOCDFWD _IO(0xB1, 1)
#define PADI_CODE 0x09
@ -108,6 +108,6 @@ struct pppoe_hdr {
__be16 sid;
__be16 length;
struct pppoe_tag tag[];
} __packed;
} __attribute__((__packed__));
#define PPPOE_SES_HLEN 8
#endif

View file

@ -22,33 +22,33 @@
struct nd_cmd_dimm_flags {
__u32 status;
__u32 flags;
} __packed;
} __attribute__((__packed__));
struct nd_cmd_get_config_size {
__u32 status;
__u32 config_size;
__u32 max_xfer;
} __packed;
} __attribute__((__packed__));
struct nd_cmd_get_config_data_hdr {
__u32 in_offset;
__u32 in_length;
__u32 status;
__u8 out_buf[];
} __packed;
} __attribute__((__packed__));
struct nd_cmd_set_config_hdr {
__u32 in_offset;
__u32 in_length;
__u8 in_buf[];
} __packed;
} __attribute__((__packed__));
struct nd_cmd_vendor_hdr {
__u32 opcode;
__u32 in_length;
__u8 in_buf[];
} __packed;
} __attribute__((__packed__));
struct nd_cmd_vendor_tail {
__u32 status;
__u32 out_length;
__u8 out_buf[];
} __packed;
} __attribute__((__packed__));
struct nd_cmd_ars_cap {
__u64 address;
__u64 length;
@ -57,7 +57,7 @@ struct nd_cmd_ars_cap {
__u32 clear_err_unit;
__u16 flags;
__u16 reserved;
} __packed;
} __attribute__((__packed__));
struct nd_cmd_ars_start {
__u64 address;
__u64 length;
@ -66,7 +66,7 @@ struct nd_cmd_ars_start {
__u8 reserved[5];
__u32 status;
__u32 scrub_time;
} __packed;
} __attribute__((__packed__));
struct nd_cmd_ars_status {
__u32 status;
__u32 out_length;
@ -82,15 +82,15 @@ struct nd_cmd_ars_status {
__u32 reserved;
__u64 err_address;
__u64 length;
} __packed records[];
} __packed;
} __attribute__((__packed__)) records[];
} __attribute__((__packed__));
struct nd_cmd_clear_error {
__u64 address;
__u64 length;
__u32 status;
__u8 reserved[4];
__u64 cleared;
} __packed;
} __attribute__((__packed__));
enum {
ND_CMD_IMPLEMENTED = 0,
ND_CMD_ARS_CAP = 1,

View file

@ -66,37 +66,37 @@ struct sev_user_data_status {
__u32 flags;
__u8 build;
__u32 guest_count;
} __packed;
} __attribute__((__packed__));
#define SEV_STATUS_FLAGS_CONFIG_ES 0x0100
struct sev_user_data_pek_csr {
__u64 address;
__u32 length;
} __packed;
} __attribute__((__packed__));
struct sev_user_data_pek_cert_import {
__u64 pek_cert_address;
__u32 pek_cert_len;
__u64 oca_cert_address;
__u32 oca_cert_len;
} __packed;
} __attribute__((__packed__));
struct sev_user_data_pdh_cert_export {
__u64 pdh_cert_address;
__u32 pdh_cert_len;
__u64 cert_chain_address;
__u32 cert_chain_len;
} __packed;
} __attribute__((__packed__));
struct sev_user_data_get_id {
__u8 socket1[64];
__u8 socket2[64];
} __packed;
} __attribute__((__packed__));
struct sev_user_data_get_id2 {
__u64 address;
__u32 length;
} __packed;
} __attribute__((__packed__));
struct sev_issue_cmd {
__u32 cmd;
__u64 data;
__u32 error;
} __packed;
} __attribute__((__packed__));
#define SEV_IOC_TYPE 'S'
#define SEV_ISSUE_CMD _IOWR(SEV_IOC_TYPE, 0x0, struct sev_issue_cmd)
#endif

View file

@ -54,5 +54,5 @@ struct qrtr_ctrl_pkt {
__le32 port;
} client;
};
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -34,7 +34,7 @@ struct tcmu_mailbox {
__u32 cmdr_size;
__u32 cmd_head;
__u32 cmd_tail __attribute__((__aligned__(ALIGN_SIZE)));
} __packed;
} __attribute__((__packed__));
enum tcmu_opcode {
TCMU_OP_PAD = 0,
TCMU_OP_CMD,
@ -48,7 +48,7 @@ struct tcmu_cmd_entry_hdr {
#define TCMU_UFLAG_READ_LEN 0x2
#define TCMU_UFLAG_KEEP_BUF 0x4
__u8 uflags;
} __packed;
} __attribute__((__packed__));
#define TCMU_OP_MASK 0x7
#define TCMU_SENSE_BUFFERSIZE 96
struct tcmu_cmd_entry {
@ -71,7 +71,7 @@ struct tcmu_cmd_entry {
char sense_buffer[TCMU_SENSE_BUFFERSIZE];
} rsp;
};
} __packed;
} __attribute__((__packed__));
struct tcmu_tmr_entry {
struct tcmu_cmd_entry_hdr hdr;
#define TCMU_TMR_UNKNOWN 0
@ -90,7 +90,7 @@ struct tcmu_tmr_entry {
__u64 __pad3;
__u64 __pad4;
__u16 cmd_ids[];
} __packed;
} __attribute__((__packed__));
#define TCMU_OP_ALIGN_SIZE sizeof(__u64)
enum tcmu_genl_cmd {
TCMU_CMD_UNSPEC,

View file

@ -75,7 +75,7 @@ struct uffd_msg {
__u64 reserved3;
} reserved;
} arg;
} __packed;
} __attribute__((__packed__));
#define UFFD_EVENT_PAGEFAULT 0x12
#define UFFD_EVENT_FORK 0x13
#define UFFD_EVENT_REMAP 0x14

View file

@ -68,5 +68,5 @@ struct uvc_meta_buf {
__u8 length;
__u8 flags;
__u8 buf[];
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -157,7 +157,7 @@ struct vmmdev_hgcm_function_parameter32 {
__u32 offset;
} page_list;
} u;
} __packed;
} __attribute__((__packed__));
struct vmmdev_hgcm_function_parameter64 {
enum vmmdev_hgcm_function_parameter_type type;
union {
@ -169,13 +169,13 @@ struct vmmdev_hgcm_function_parameter64 {
__u64 phys_addr;
__u64 linear_addr;
} u;
} __packed pointer;
} __attribute__((__packed__)) pointer;
struct {
__u32 size;
__u32 offset;
} page_list;
} __packed u;
} __packed;
} __attribute__((__packed__)) u;
} __attribute__((__packed__));
#if __BITS_PER_LONG == 64
#define vmmdev_hgcm_function_parameter vmmdev_hgcm_function_parameter64
#else

View file

@ -27,19 +27,19 @@ struct ccw_io_region {
#define IRB_AREA_SIZE 96
__u8 irb_area[IRB_AREA_SIZE];
__u32 ret_code;
} __packed;
} __attribute__((__packed__));
#define VFIO_CCW_ASYNC_CMD_HSCH (1 << 0)
#define VFIO_CCW_ASYNC_CMD_CSCH (1 << 1)
struct ccw_cmd_region {
__u32 command;
__u32 ret_code;
} __packed;
} __attribute__((__packed__));
struct ccw_schib_region {
#define SCHIB_AREA_SIZE 52
__u8 schib_area[SCHIB_AREA_SIZE];
} __packed;
} __attribute__((__packed__));
struct ccw_crw_region {
__u32 crw;
__u32 pad;
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -30,17 +30,17 @@ struct calling_interface_buffer {
__u16 cmd_select;
volatile __u32 input[4];
volatile __u32 output[4];
} __packed;
} __attribute__((__packed__));
struct dell_wmi_extensions {
__u32 argattrib;
__u32 blength;
__u8 data[];
} __packed;
} __attribute__((__packed__));
struct dell_wmi_smbios_buffer {
__u64 length;
struct calling_interface_buffer std;
struct dell_wmi_extensions ext;
} __packed;
} __attribute__((__packed__));
#define CLASS_TOKEN_READ 0
#define CLASS_TOKEN_WRITE 1
#define SELECT_TOKEN_STD 0

View file

@ -42,7 +42,7 @@ struct Node {
__u8 ln_Type;
__s8 ln_Pri;
__be32 ln_Name;
} __packed;
} __attribute__((__packed__));
struct ExpansionRom {
__u8 er_Type;
__u8 er_Product;
@ -55,7 +55,7 @@ struct ExpansionRom {
__u8 er_Reserved0d;
__u8 er_Reserved0e;
__u8 er_Reserved0f;
} __packed;
} __attribute__((__packed__));
#define ERT_TYPEMASK 0xc0
#define ERT_ZORROII 0xc0
#define ERT_ZORROIII 0x80
@ -73,6 +73,6 @@ struct ConfigDev {
__be32 cd_Driver;
__be32 cd_NextCD;
__be32 cd_Unused[4];
} __packed;
} __attribute__((__packed__));
#define ZORRO_NUM_AUTO 16
#endif

View file

@ -72,11 +72,11 @@ struct ubi_mkvol_req {
__s16 name_len;
__s8 padding2[4];
char name[UBI_MAX_VOLUME_NAME + 1];
} __packed;
} __attribute__((__packed__));
struct ubi_rsvol_req {
__s64 bytes;
__s32 vol_id;
} __packed;
} __attribute__((__packed__));
struct ubi_rnvol_req {
__s32 count;
__s8 padding1[12];
@ -86,24 +86,24 @@ struct ubi_rnvol_req {
__s8 padding2[2];
char name[UBI_MAX_VOLUME_NAME + 1];
} ents[UBI_MAX_RNVOL];
} __packed;
} __attribute__((__packed__));
struct ubi_leb_change_req {
__s32 lnum;
__s32 bytes;
__s8 dtype;
__s8 padding[7];
} __packed;
} __attribute__((__packed__));
struct ubi_map_req {
__s32 lnum;
__s8 dtype;
__s8 padding[3];
} __packed;
} __attribute__((__packed__));
struct ubi_set_vol_prop_req {
__u8 property;
__u8 padding[7];
__u64 value;
} __packed;
} __attribute__((__packed__));
struct ubi_blkcreate_req {
__s8 padding[128];
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -356,7 +356,7 @@ struct snd_soc_tplg_manifest_v4 {
__le32 pcm_elems;
__le32 dai_link_elems;
struct snd_soc_tplg_private priv;
} __packed;
} __attribute__((__packed__));
struct snd_soc_tplg_stream_caps_v4 {
__le32 size;
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
@ -372,7 +372,7 @@ struct snd_soc_tplg_stream_caps_v4 {
__le32 period_size_max;
__le32 buffer_size_min;
__le32 buffer_size_max;
} __packed;
} __attribute__((__packed__));
struct snd_soc_tplg_pcm_v4 {
__le32 size;
char pcm_name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
@ -385,11 +385,11 @@ struct snd_soc_tplg_pcm_v4 {
struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
__le32 num_streams;
struct snd_soc_tplg_stream_caps_v4 caps[2];
} __packed;
} __attribute__((__packed__));
struct snd_soc_tplg_link_config_v4 {
__le32 size;
__le32 id;
struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX];
__le32 num_streams;
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -605,7 +605,7 @@ struct snd_rawmidi_framing_tstamp {
__u32 tv_nsec;
__u64 tv_sec;
__u8 data[SNDRV_RAWMIDI_FRAMING_DATA_LENGTH];
} __packed;
} __attribute__((__packed__));
struct snd_rawmidi_params {
int stream;
size_t buffer_size;

View file

@ -111,7 +111,7 @@ struct skl_dfw_algo_data {
__u32 param_id;
__u32 max;
char params[];
} __packed;
} __attribute__((__packed__));
enum skl_tkn_dir {
SKL_DIR_IN,
SKL_DIR_OUT
@ -123,7 +123,7 @@ enum skl_tuple_type {
struct skl_dfw_v4_module_pin {
__u16 module_id;
__u16 instance_id;
} __packed;
} __attribute__((__packed__));
struct skl_dfw_v4_module_fmt {
__u32 channels;
__u32 freq;
@ -133,21 +133,21 @@ struct skl_dfw_v4_module_fmt {
__u32 interleaving_style;
__u32 sample_type;
__u32 ch_map;
} __packed;
} __attribute__((__packed__));
struct skl_dfw_v4_module_caps {
__u32 set_params : 2;
__u32 rsvd : 30;
__u32 param_id;
__u32 caps_size;
__u32 caps[HDA_SST_CFG_MAX];
} __packed;
} __attribute__((__packed__));
struct skl_dfw_v4_pipe {
__u8 pipe_id;
__u8 pipe_priority;
__u16 conn_type : 4;
__u16 rsvd : 4;
__u16 memory_pages : 8;
} __packed;
} __attribute__((__packed__));
struct skl_dfw_v4_module {
char uuid[SKL_UUID_STR_SZ];
__u16 module_id;
@ -181,5 +181,5 @@ struct skl_dfw_v4_module {
struct skl_dfw_v4_module_pin in_pin[MAX_IN_QUEUE];
struct skl_dfw_v4_module_pin out_pin[MAX_OUT_QUEUE];
struct skl_dfw_v4_module_caps caps;
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -46,7 +46,7 @@ struct snd_sof_blk_hdr {
enum snd_sof_fw_blk_type type;
__u32 size;
__u32 offset;
} __packed;
} __attribute__((__packed__));
enum snd_sof_fw_mod_type {
SOF_FW_BASE = 0,
SOF_FW_MODULE = 1,
@ -55,11 +55,11 @@ struct snd_sof_mod_hdr {
enum snd_sof_fw_mod_type type;
__u32 size;
__u32 num_blocks;
} __packed;
} __attribute__((__packed__));
struct snd_sof_fw_header {
unsigned char sig[SND_SOF_FW_SIG_SIZE];
__u32 file_size;
__u32 num_modules;
__u32 abi;
} __packed;
} __attribute__((__packed__));
#endif

View file

@ -26,7 +26,7 @@ struct sof_abi_hdr {
__u32 abi;
__u32 reserved[4];
__u32 data[];
} __packed;
} __attribute__((__packed__));
#define SOF_MANIFEST_DATA_TYPE_NHLT 1
struct sof_manifest_tlv {
__le32 type;