Skip to content

Commit 1a2d74a

Browse files
fabiobaltierinashif
authored andcommitted
device_mmio: use explicit unsigned literals for addresses
Add an explicit unsigned literal suffix (U) for addresses obtained from devicetree, this is to work around a specific warning: zephyrproject/zephyr/include/zephyr/arch/arm/cortex_a_r/timer.h:40:2: warning: this decimal constant is unsigned only in ISO C90 When compling west build -p -b qemu_cortex_a9 -T tests/lib/cpp/cxx/cpp.main.cpp98 Argueably all devicetree addresses and sizes should be unsigned but this is enough to make CI pass, may look into changing the device.h macro as a followup. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
1 parent e428a52 commit 1a2d74a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/zephyr/sys/device_mmio.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ struct z_device_mmio_rom {
6363

6464
#define Z_DEVICE_MMIO_ROM_INITIALIZER(node_id) \
6565
{ \
66-
.phys_addr = DT_REG_ADDR(node_id), \
66+
.phys_addr = UINT32_C(DT_REG_ADDR(node_id)), \
6767
.size = DT_REG_SIZE(node_id) \
6868
}
6969

7070
#define Z_DEVICE_MMIO_NAMED_ROM_INITIALIZER(name, node_id) \
7171
{ \
72-
.phys_addr = DT_REG_ADDR_BY_NAME(node_id, name), \
72+
.phys_addr = UINT32_C(DT_REG_ADDR_BY_NAME(node_id, name)), \
7373
.size = DT_REG_SIZE_BY_NAME(node_id, name) \
7474
}
7575

0 commit comments

Comments
 (0)