diff --git a/ipa/core/inc/wlan_ipa_priv.h b/ipa/core/inc/wlan_ipa_priv.h index 60bd9121ad..cee3646002 100644 --- a/ipa/core/inc/wlan_ipa_priv.h +++ b/ipa/core/inc/wlan_ipa_priv.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -209,7 +209,7 @@ struct wlan_ipa_tx_hdr { * @reserved: Reserved not used */ struct frag_header { - uint8_t reserved[0]; + __QDF_DECLARE_FLEX_ARRAY(uint8_t, reserved); }; #elif defined(QCA_WIFI_3_0) /** @@ -241,7 +241,7 @@ struct frag_header { * @reserved: Reserved not used */ struct ipa_header { - uint8_t reserved[0]; + __QDF_DECLARE_FLEX_ARRAY(uint8_t, reserved); }; #else /** diff --git a/qdf/inc/qdf_ptr_hash.h b/qdf/inc/qdf_ptr_hash.h index 59fc871e0c..e798f0e70e 100644 --- a/qdf/inc/qdf_ptr_hash.h +++ b/qdf/inc/qdf_ptr_hash.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2019 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -65,7 +65,7 @@ struct qdf_ptr_hash_bucket { struct qdf_ptr_hash { int8_t bits; int16_t count; - struct qdf_ptr_hash_bucket buckets[0]; + struct qdf_ptr_hash_bucket buckets[]; }; /** diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h index 1c72a0f552..8f503f65ec 100644 --- a/qdf/inc/qdf_types.h +++ b/qdf/inc/qdf_types.h @@ -37,14 +37,17 @@ /* Preprocessor definitions and constants */ #define QDF_MAX_SGLIST 4 +#define __QDF_DECLARE_FLEX_ARRAY(type, name) \ + struct { \ + struct {} dummy_struct; \ + type name[]; \ + } + /* Define a QDF macro for declaring flexible arrays */ #define QDF_FLEX_ARRAY(type, name) \ union { \ type name ## _first_element; \ - struct { \ - struct {} dummy_struct; \ - type name[]; \ - }; \ + __QDF_DECLARE_FLEX_ARRAY(type, name); \ } /* diff --git a/spectral/dispatcher/inc/spectral_ioctl.h b/spectral/dispatcher/inc/spectral_ioctl.h index 94f8e70075..bbc37e309c 100644 --- a/spectral/dispatcher/inc/spectral_ioctl.h +++ b/spectral/dispatcher/inc/spectral_ioctl.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2011, 2017-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -562,7 +562,7 @@ struct samp_detector_info { uint8_t is_sec80; uint8_t blanking_status; /* Padding bits to make struct size multiple of 4 bytes */ - uint8_t padding_detector_info[0]; + uint8_t padding_detector_info[]; } __packed; /* Compile time assert to check struct size is divisible by 4 Bytes */ @@ -641,7 +641,7 @@ struct spectral_samp_msg { uint8_t dcs_enabled; uint8_t int_type; uint8_t num_freq_spans; - uint8_t bin_pwr[0]; /*This should be the last item in the structure*/ + uint8_t bin_pwr[]; /*This should be the last item in the structure*/ } __packed; #else diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h index bac12cc172..16e6a386fb 100644 --- a/target_if/spectral/target_if_spectral.h +++ b/target_if/spectral/target_if_spectral.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -285,7 +285,7 @@ typedef uint32_t SPECTRAL_SEGID_INFO; * @buf: fft report */ struct spectral_phyerr_fft_gen2 { - uint8_t buf[0]; + __QDF_DECLARE_FLEX_ARRAY(uint8_t, buf); }; /** @@ -463,7 +463,7 @@ struct spectral_phyerr_fft_report_gen3 { uint32_t hdr_b; uint32_t hdr_c; uint32_t resv; - uint8_t buf[0]; + uint8_t buf[]; } __ATTRIB_PACK; /** diff --git a/umac/cmn_services/regulatory/inc/wlan_reg_afc.h b/umac/cmn_services/regulatory/inc/wlan_reg_afc.h index da5df92a76..491539f62b 100644 --- a/umac/cmn_services/regulatory/inc/wlan_reg_afc.h +++ b/umac/cmn_services/regulatory/inc/wlan_reg_afc.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -180,7 +180,7 @@ struct wlan_afc_host_resp { uint32_t time_to_live; uint32_t length; uint32_t resp_format; - uint8_t afc_resp[0]; + uint8_t afc_resp[]; } qdf_packed; /** diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h b/umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h index 694693b497..ae5d8e48e7 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2011, 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2010, Atheros Communications Inc. * All Rights Reserved. * @@ -358,7 +358,7 @@ struct synthetic_pulse { struct synthetic_seq { uint8_t num_pulses; uint32_t total_len_seq; - struct synthetic_pulse *pulse[0]; + struct synthetic_pulse *pulse[]; }; /** @@ -370,7 +370,7 @@ struct synthetic_seq { struct seq_store { uint8_t num_sequence; - struct synthetic_seq *seq_arr[0]; + struct synthetic_seq *seq_arr[]; }; #endif /* WLAN_DFS_PARTIAL_OFFLOAD && WLAN_DFS_SYNTHETIC_RADAR */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 75c133e07c..bbccb906e7 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -9149,7 +9149,7 @@ struct wmi_roam_scan_stats_params { */ struct wmi_roam_scan_stats_res { uint32_t num_roam_scans; - struct wmi_roam_scan_stats_params roam_scan[0]; + struct wmi_roam_scan_stats_params roam_scan[]; }; #define MAX_ROAM_CANDIDATE_AP 9 diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index f73eae55ae..695ba7a2d3 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -158,7 +158,7 @@ struct wmi_ext_dbg_msg { uint32_t len; uint64_t ts; enum WMI_MSG_TYPE type; - uint8_t buf[0]; + uint8_t buf[]; }; #endif /*WMI_EXT_DBG */