qcacmn: Add support for size 0 flexible length arrays
Convert size 0 variable length arrays to flexible length arrays. Change-Id: I679a5183a4ec0bebe51396694d2ae33afecfe80f CRs-Fixed: 3690242
This commit is contained in:

committed by
Ravindra Konda

szülő
53ef6cc7ce
commit
319d20734f
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* 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
|
* @reserved: Reserved not used
|
||||||
*/
|
*/
|
||||||
struct frag_header {
|
struct frag_header {
|
||||||
uint8_t reserved[0];
|
__QDF_DECLARE_FLEX_ARRAY(uint8_t, reserved);
|
||||||
};
|
};
|
||||||
#elif defined(QCA_WIFI_3_0)
|
#elif defined(QCA_WIFI_3_0)
|
||||||
/**
|
/**
|
||||||
@@ -241,7 +241,7 @@ struct frag_header {
|
|||||||
* @reserved: Reserved not used
|
* @reserved: Reserved not used
|
||||||
*/
|
*/
|
||||||
struct ipa_header {
|
struct ipa_header {
|
||||||
uint8_t reserved[0];
|
__QDF_DECLARE_FLEX_ARRAY(uint8_t, reserved);
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* 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 {
|
struct qdf_ptr_hash {
|
||||||
int8_t bits;
|
int8_t bits;
|
||||||
int16_t count;
|
int16_t count;
|
||||||
struct qdf_ptr_hash_bucket buckets[0];
|
struct qdf_ptr_hash_bucket buckets[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -37,14 +37,17 @@
|
|||||||
/* Preprocessor definitions and constants */
|
/* Preprocessor definitions and constants */
|
||||||
#define QDF_MAX_SGLIST 4
|
#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 a QDF macro for declaring flexible arrays */
|
||||||
#define QDF_FLEX_ARRAY(type, name) \
|
#define QDF_FLEX_ARRAY(type, name) \
|
||||||
union { \
|
union { \
|
||||||
type name ## _first_element; \
|
type name ## _first_element; \
|
||||||
struct { \
|
__QDF_DECLARE_FLEX_ARRAY(type, name); \
|
||||||
struct {} dummy_struct; \
|
|
||||||
type name[]; \
|
|
||||||
}; \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2017-2021 The Linux Foundation. All rights reserved.
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* 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 is_sec80;
|
||||||
uint8_t blanking_status;
|
uint8_t blanking_status;
|
||||||
/* Padding bits to make struct size multiple of 4 bytes */
|
/* Padding bits to make struct size multiple of 4 bytes */
|
||||||
uint8_t padding_detector_info[0];
|
uint8_t padding_detector_info[];
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
/* Compile time assert to check struct size is divisible by 4 Bytes */
|
/* 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 dcs_enabled;
|
||||||
uint8_t int_type;
|
uint8_t int_type;
|
||||||
uint8_t num_freq_spans;
|
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;
|
} __packed;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved.
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* 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
|
* @buf: fft report
|
||||||
*/
|
*/
|
||||||
struct spectral_phyerr_fft_gen2 {
|
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_b;
|
||||||
uint32_t hdr_c;
|
uint32_t hdr_c;
|
||||||
uint32_t resv;
|
uint32_t resv;
|
||||||
uint8_t buf[0];
|
uint8_t buf[];
|
||||||
} __ATTRIB_PACK;
|
} __ATTRIB_PACK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
* 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
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* 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 time_to_live;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
uint32_t resp_format;
|
uint32_t resp_format;
|
||||||
uint8_t afc_resp[0];
|
uint8_t afc_resp[];
|
||||||
} qdf_packed;
|
} qdf_packed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, 2016-2021 The Linux Foundation. All rights reserved.
|
* 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.
|
* Copyright (c) 2010, Atheros Communications Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
@@ -358,7 +358,7 @@ struct synthetic_pulse {
|
|||||||
struct synthetic_seq {
|
struct synthetic_seq {
|
||||||
uint8_t num_pulses;
|
uint8_t num_pulses;
|
||||||
uint32_t total_len_seq;
|
uint32_t total_len_seq;
|
||||||
struct synthetic_pulse *pulse[0];
|
struct synthetic_pulse *pulse[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -370,7 +370,7 @@ struct synthetic_seq {
|
|||||||
|
|
||||||
struct seq_store {
|
struct seq_store {
|
||||||
uint8_t num_sequence;
|
uint8_t num_sequence;
|
||||||
struct synthetic_seq *seq_arr[0];
|
struct synthetic_seq *seq_arr[];
|
||||||
};
|
};
|
||||||
#endif /* WLAN_DFS_PARTIAL_OFFLOAD && WLAN_DFS_SYNTHETIC_RADAR */
|
#endif /* WLAN_DFS_PARTIAL_OFFLOAD && WLAN_DFS_SYNTHETIC_RADAR */
|
||||||
|
|
||||||
|
@@ -9149,7 +9149,7 @@ struct wmi_roam_scan_stats_params {
|
|||||||
*/
|
*/
|
||||||
struct wmi_roam_scan_stats_res {
|
struct wmi_roam_scan_stats_res {
|
||||||
uint32_t num_roam_scans;
|
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
|
#define MAX_ROAM_CANDIDATE_AP 9
|
||||||
|
@@ -158,7 +158,7 @@ struct wmi_ext_dbg_msg {
|
|||||||
uint32_t len;
|
uint32_t len;
|
||||||
uint64_t ts;
|
uint64_t ts;
|
||||||
enum WMI_MSG_TYPE type;
|
enum WMI_MSG_TYPE type;
|
||||||
uint8_t buf[0];
|
uint8_t buf[];
|
||||||
};
|
};
|
||||||
#endif /*WMI_EXT_DBG */
|
#endif /*WMI_EXT_DBG */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user