Skip to content

Commit 5351fc6

Browse files
committed
[nrf fromlist] soc: nordic: dmm: Fix DMM_REG_ALIGN_SIZE macro when CONFIG_DCACHE=n
Upstream PR #: 80676 Make sure this expansion doesn't include `CONFIG_DCACHE_LINE_SIZE`, which would be undefined and produce a build error. Signed-off-by: Grzegorz Swiderski <[email protected]> (cherry picked from commit 369fb693575c916fc5406e4954262d6687052a5b)
1 parent d59b845 commit 5351fc6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

soc/nordic/common/dmm.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ extern "C" {
3333
/* Determine required alignment of the data buffers in specified memory region.
3434
* Cache line alignment is required if region is cacheable and data cache is enabled.
3535
*/
36-
#define DMM_REG_ALIGN_SIZE(node_id) \
37-
(DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t))
36+
#define DMM_REG_ALIGN_SIZE(node_id) \
37+
COND_CODE_1(CONFIG_DCACHE, \
38+
(DMM_IS_REG_CACHEABLE(node_id) ? CONFIG_DCACHE_LINE_SIZE : sizeof(uint8_t)), \
39+
(sizeof(uint8_t)))
3840

3941
/* Determine required alignment of the data buffers in memory region
4042
* associated with specified device node.

0 commit comments

Comments
 (0)