a-lunev commented on a change in pull request #4236:
URL: https://github.com/apache/incubator-nuttx/pull/4236#discussion_r677698367
##########
File path: drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.h
##########
@@ -110,13 +111,22 @@ struct bcmf_sdio_dev_s
/* Structure used to manage SDIO frames */
+struct __attribute__((packed)) bcmf_dma_buf
+{
+ uint8_t align_padding[CONFIG_IEEE80211_BROADCOM_SDIO_DMA_BUF_ALIGNMENT -
Review comment:
> So, you declare the buffer is 16bytes alignment and skip the 12bytes
manually. But, why not directly align the buffer 12bytes directly liket this:
>
> ```
> uint8_t data[HEADER_SIZE + MAX_NETDEV_PKTSIZE + CONFIG_NET_GUARDSIZE]
> aligned_data(CONFIG_IEEE80211_BROADCOM_SDIO_DMA_BUF_ALIGNMENT - 4);
> ```
Any alignment must be power of 2 (it's the gcc standard requirement):
```
wireless/ieee80211/bcm43xxx/bcmf_sdio.h:130:3: error: requested alignment is
not a positive power of 2
uint8_t data2[32] aligned_data(12);
^~~~~~~
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]