Bluetooth: Controller: Use offsetof() in memory sizing
GCC requires __builtin_offsetof() to be used whenever sizing arrays with its help. Now that stddef.h includes conditional compilation, use the macro instead of hardcoding the GCC usage. Jira: ZEP-732 Change-Id: Ieb5c694e1dc8323bd1fa2d18711a893f8824c5b1 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
68182568cb
commit
2334e225b7
1 changed files with 7 additions and 7 deletions
|
@ -209,12 +209,12 @@ struct pdu_data_q_tx {
|
|||
#define LL_MEM_TXQ (sizeof(struct pdu_data_q_tx) * \
|
||||
(RADIO_PACKET_COUNT_TX_MAX + 2))
|
||||
|
||||
#define LL_MEM_RX_POOL_SZ (ALIGN4(__builtin_offsetof(struct radio_pdu_node_rx,\
|
||||
#define LL_MEM_RX_POOL_SZ (ALIGN4(offsetof(struct radio_pdu_node_rx,\
|
||||
pdu_data) + ((\
|
||||
(RADIO_ACPDU_SIZE_MAX + 1) < \
|
||||
(__builtin_offsetof(struct pdu_data, payload) + \
|
||||
(offsetof(struct pdu_data, payload) + \
|
||||
RADIO_LL_LENGTH_OCTETS_RX_MAX)) ? \
|
||||
(__builtin_offsetof(struct pdu_data, payload) + \
|
||||
(offsetof(struct pdu_data, payload) + \
|
||||
RADIO_LL_LENGTH_OCTETS_RX_MAX) \
|
||||
: \
|
||||
(RADIO_ACPDU_SIZE_MAX + 1))) * \
|
||||
|
@ -223,13 +223,13 @@ struct pdu_data_q_tx {
|
|||
#define LL_MEM_RX_LINK_POOL (sizeof(void *) * 2 * ((RADIO_PACKET_COUNT_RX_MAX +\
|
||||
4) + RADIO_CONNECTION_CONTEXT_MAX))
|
||||
|
||||
#define LL_MEM_TX_CTRL_POOL ((ALIGN4(__builtin_offsetof( \
|
||||
#define LL_MEM_TX_CTRL_POOL ((ALIGN4(offsetof( \
|
||||
struct radio_pdu_node_tx, pdu_data) + \
|
||||
__builtin_offsetof(struct pdu_data, payload) + 27)) * \
|
||||
offsetof(struct pdu_data, payload) + 27)) * \
|
||||
PACKET_MEM_COUNT_TX_CTRL)
|
||||
#define LL_MEM_TX_DATA_POOL ((ALIGN4(__builtin_offsetof( \
|
||||
#define LL_MEM_TX_DATA_POOL ((ALIGN4(offsetof( \
|
||||
struct radio_pdu_node_tx, pdu_data) + \
|
||||
__builtin_offsetof(struct pdu_data, payload) + \
|
||||
offsetof(struct pdu_data, payload) + \
|
||||
RADIO_LL_LENGTH_OCTETS_RX_MAX)) \
|
||||
* (RADIO_PACKET_COUNT_TX_MAX + 1))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue