mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
Currently, to compute the 'item' size in a ring buffer, we have `SIZE32_OF`. Several issues with this: - `SIZE32_OF` only works on variables, not types, due to an extra parenthesis pair. Indeed, `sizeof((int))` is not valid C, whereas `sizeof((my_var))` is. - `SIZE32_OF` is not a proper public API - `SIZE32_OF` rounds down if the argument size is not a multiple of 4 bytes. Thus, we introduce a proper `RING_BUF_ITEM_SIZEOF`, fixing the aforementioned issues. Signed-off-by: Henri Xavier <datacomos@huawei.com>