diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2024-05-02 10:55:31 -0600 |
---|---|---|
committer | Gustavo A. R. Silva <gustavoars@kernel.org> | 2024-05-02 10:55:31 -0600 |
commit | f4d622e4c21a03b694e3ffe991cff14742187f5f (patch) | |
tree | 0fe9f431a43d21b0cdf96162998effb2ddbcceed | |
parent | 32dd533c83a1eb54f2bd6901d30d7ee78365dee7 (diff) | |
download | linux-testing/WFAMNAE-next20240501-CbC.tar.gz |
treewide_some: fix multiple -Wfamnae warnings that must be audited separatelytesting/WFAMNAE-next20240501-CbC
FIX the following errors so we can have a clean build. This is a
temporary workaround and the code should be audited and properly fixed
up later.
./include/linux/bpf.h:1990:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/asm-generic/hyperv-tlfs.h:494:25: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/hyperv.h:767:38: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/kvm_host.h:1842:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/bpf.h:1990:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/asm-generic/hyperv-tlfs.h:494:25: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/hyperv.h:767:38: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/kvm_host.h:1842:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/bpf.h:1990:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/asm-generic/hyperv-tlfs.h:494:25: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
...+./include/linux/hyperv.h:767:38: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
..........+...../include/linux/kvm_host.h:1842:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/bpf.h:1990:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/bpf.h:1990:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h:109:28: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h:109:28: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
./include/linux/bpf.h:1990:31: error: structure containing a flexible array member is not at the end of another structure [-Werror=flex-array-member-not-at-end]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-rw-r--r-- | arch/x86/hyperv/mmu.c | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/setup_data.h | 2 | ||||
-rw-r--r-- | arch/x86/include/uapi/asm/setup_data.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 6 | ||||
-rw-r--r-- | include/asm-generic/hyperv-tlfs.h | 8 | ||||
-rw-r--r-- | include/linux/bpf-cgroup.h | 2 | ||||
-rw-r--r-- | include/linux/bpf.h | 6 | ||||
-rw-r--r-- | include/linux/hyperv.h | 42 | ||||
-rw-r--r-- | include/linux/kvm_host.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/kvm.h | 12 | ||||
-rw-r--r-- | kernel/bpf/core.c | 4 |
13 files changed, 56 insertions, 46 deletions
diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c index 1cc113200ff558..f7666b895cddc0 100644 --- a/arch/x86/hyperv/mmu.c +++ b/arch/x86/hyperv/mmu.c @@ -198,7 +198,7 @@ static u64 hyperv_flush_tlb_others_ex(const struct cpumask *cpus, flush->hv_vp_set.valid_bank_mask = 0; flush->hv_vp_set.format = HV_GENERIC_SET_SPARSE_4K; - nr_bank = cpumask_to_vpset_skip(&flush->hv_vp_set, cpus, + nr_bank = cpumask_to_vpset_skip((struct hv_vpset *)&flush->hv_vp_set, cpus, info->freed_tables ? NULL : cpu_is_lazy); if (nr_bank < 0) return HV_STATUS_INVALID_PARAMETER; @@ -209,7 +209,7 @@ static u64 hyperv_flush_tlb_others_ex(const struct cpumask *cpus, */ max_gvas = (PAGE_SIZE - sizeof(*flush) - nr_bank * - sizeof(flush->hv_vp_set.bank_contents[0])) / + sizeof(((struct hv_vpset *)&flush->hv_vp_set)->bank_contents[0])) / sizeof(flush->gva_list[0]); if (info->end == TLB_FLUSH_ALL) { diff --git a/arch/x86/include/asm/setup_data.h b/arch/x86/include/asm/setup_data.h index 77c51111a89394..a911a5c5719d0a 100644 --- a/arch/x86/include/asm/setup_data.h +++ b/arch/x86/include/asm/setup_data.h @@ -7,7 +7,7 @@ #ifndef __ASSEMBLY__ struct pci_setup_rom { - struct setup_data data; + struct setup_data_hdr data; uint16_t vendor; uint16_t devid; uint64_t pcilen; diff --git a/arch/x86/include/uapi/asm/setup_data.h b/arch/x86/include/uapi/asm/setup_data.h index b111b0c1854491..7f38c6fe0fc784 100644 --- a/arch/x86/include/uapi/asm/setup_data.h +++ b/arch/x86/include/uapi/asm/setup_data.h @@ -24,9 +24,11 @@ /* extensible setup data list node */ struct setup_data { - __u64 next; - __u32 type; - __u32 len; + __struct_group(setup_data_hdr, hdr, /* no attrs */, + __u64 next; + __u32 type; + __u32 len; + ); __u8 data[]; }; diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index f9ca4f8fa6c543..145b3b81e7171d 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -31,7 +31,7 @@ endif # --- end copy-paste # Enable -Werror in CI and development -subdir-ccflags-$(CONFIG_DRM_WERROR) += -Werror +#subdir-ccflags-$(CONFIG_DRM_WERROR) += -Werror drm-y := \ drm_aperture.o \ diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index f87d53e183c3d0..4462ed09e67cbd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1034,8 +1034,6 @@ struct amdgpu_device { /* for userq and VM fences */ struct amdgpu_seq64 seq64; - /* KFD */ - struct amdgpu_kfd_dev kfd; /* UMC */ struct amdgpu_umc umc; @@ -1161,6 +1159,8 @@ struct amdgpu_device { bool debug_largebar; bool debug_disable_soft_recovery; bool debug_use_vram_fw_buf; + /* KFD */ + struct amdgpu_kfd_dev kfd; }; static inline uint32_t amdgpu_ip_version(const struct amdgpu_device *adev, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h index 1de021ebdd467b..d3d69b4dcbf604 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h @@ -105,11 +105,11 @@ struct amdgpu_kfd_dev { bool init_complete; struct work_struct reset_work; - /* HMM page migration MEMORY_DEVICE_PRIVATE mapping */ - struct dev_pagemap pgmap; - /* Client for KFD BO GEM handle allocations */ struct drm_client_dev client; + + /* HMM page migration MEMORY_DEVICE_PRIVATE mapping */ + struct dev_pagemap pgmap; }; enum kgd_engine_type { diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h index 814207e7c37fcf..1f083945104e05 100644 --- a/include/asm-generic/hyperv-tlfs.h +++ b/include/asm-generic/hyperv-tlfs.h @@ -411,8 +411,10 @@ union hv_synic_siefp { }; struct hv_vpset { - u64 format; - u64 valid_bank_mask; + struct_group_tagged(hv_vpset_hdr, hdr, + u64 format; + u64 valid_bank_mask; + ); u64 bank_contents[]; } __packed; @@ -491,7 +493,7 @@ struct hv_tlb_flush { struct hv_tlb_flush_ex { u64 address_space; u64 flags; - struct hv_vpset hv_vp_set; + struct hv_vpset_hdr hv_vp_set; u64 gva_list[]; } __packed; diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index fb3c3e7181e6d8..f698e2ee6a0aa5 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h @@ -188,7 +188,7 @@ static inline bool cgroup_bpf_sock_enabled(struct sock *sk, struct bpf_prog_array *array; array = rcu_access_pointer(cgrp->bpf.effective[type]); - return array != &bpf_empty_prog_array.hdr; + return array != (struct bpf_prog_array *)&bpf_empty_prog_array.hdr; } /* Wrappers for __cgroup_bpf_run_filter_skb() guarded by cgroup_bpf_enabled. */ diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 5e694a308081aa..79805dc35d15d4 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -1993,12 +1993,14 @@ struct bpf_prog_array_item { }; struct bpf_prog_array { - struct rcu_head rcu; + struct_group_tagged(bpf_prog_array_hdr, hdr, + struct rcu_head rcu; + ); struct bpf_prog_array_item items[]; }; struct bpf_empty_prog_array { - struct bpf_prog_array hdr; + struct bpf_prog_array_hdr hdr; struct bpf_prog *null_prog; }; diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 5e39baa7f6cbb6..8847bc6e01b56b 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -737,25 +737,27 @@ enum vmbus_channel_state { * variable-size data structure depending on the msg type itself */ struct vmbus_channel_msginfo { - /* Bookkeeping stuff */ - struct list_head msglistentry; - - /* So far, this is only used to handle gpadl body message */ - struct list_head submsglist; - - /* Synchronize the request/response if needed */ - struct completion waitevent; - struct vmbus_channel *waiting_channel; - union { - struct vmbus_channel_version_supported version_supported; - struct vmbus_channel_open_result open_result; - struct vmbus_channel_gpadl_torndown gpadl_torndown; - struct vmbus_channel_gpadl_created gpadl_created; - struct vmbus_channel_version_response version_response; - struct vmbus_channel_modifychannel_response modify_response; - } response; - - u32 msgsize; + struct_group_tagged(vmbus_channel_msginfo_hdr, hdr, + /* Bookkeeping stuff */ + struct list_head msglistentry; + + /* So far, this is only used to handle gpadl body message */ + struct list_head submsglist; + + /* Synchronize the request/response if needed */ + struct completion waitevent; + struct vmbus_channel *waiting_channel; + union { + struct vmbus_channel_version_supported version_supported; + struct vmbus_channel_open_result open_result; + struct vmbus_channel_gpadl_torndown gpadl_torndown; + struct vmbus_channel_gpadl_created gpadl_created; + struct vmbus_channel_version_response version_response; + struct vmbus_channel_modifychannel_response modify_response; + } response; + + u32 msgsize; + ); /* * The channel message that goes out on the "wire". * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header @@ -764,7 +766,7 @@ struct vmbus_channel_msginfo { }; struct vmbus_close_msg { - struct vmbus_channel_msginfo info; + struct vmbus_channel_msginfo_hdr info; struct vmbus_channel_close_channel msg; }; diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index afbc99264ffa47..148154e376d4cd 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1837,7 +1837,7 @@ struct kvm_stat_data { }; struct _kvm_stats_desc { - struct kvm_stats_desc desc; + struct kvm_stats_desc_hdr desc; char name[KVM_STATS_NAME_SIZE]; }; diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 2190adbe30027c..c33375ae58d77d 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1505,11 +1505,13 @@ struct kvm_stats_header { * &kvm_stats_header->name_size. */ struct kvm_stats_desc { - __u32 flags; - __s16 exponent; - __u16 size; - __u32 offset; - __u32 bucket_size; + __struct_group(kvm_stats_desc_hdr, hdr, /* no attrs */, + __u32 flags; + __s16 exponent; + __u16 size; + __u32 offset; + __u32 bucket_size; + ); char name[]; }; diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 5ad12afb476164..8f2af8bc2881cd 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -2461,14 +2461,14 @@ struct bpf_prog_array *bpf_prog_array_alloc(u32 prog_cnt, gfp_t flags) if (prog_cnt) p = kzalloc(struct_size(p, items, prog_cnt + 1), flags); else - p = &bpf_empty_prog_array.hdr; + p = (struct bpf_prog_array *)&bpf_empty_prog_array.hdr; return p; } void bpf_prog_array_free(struct bpf_prog_array *progs) { - if (!progs || progs == &bpf_empty_prog_array.hdr) + if (!progs || progs == (struct bpf_prog_array *)&bpf_empty_prog_array.hdr) return; kfree_rcu(progs, rcu); } |