Skip to content

Commit 2c851d9

Browse files
thugheskartben
authored andcommitted
sw_isr_table: Add braces around subobject
When building with clang, it warns: subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_shi_npcx.c:1000:2: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), shi_npcx_isr, DEVICE_DT_INST_GET(0), 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/zephyr/irq.h:49:2: note: expanded from macro 'IRQ_CONNECT' ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/zephyr/arch/arm/irq.h:124:2: note: expanded from macro 'ARCH_IRQ_CONNECT' Z_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/zephyr/sw_isr_table.h:227:2: note: expanded from macro 'Z_ISR_DECLARE' Z_ISR_DECLARE_C(irq, flags, func, param, __COUNTER__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/zephyr/sw_isr_table.h:218:16: note: expanded from macro '_Z_ISR_DECLARE_C' {irq, flags, _MK_ISR_ELEMENT_SECTION(counter)} ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/zephyr/sw_isr_table.h:197:42: note: expanded from macro '_MK_ISR_ELEMENT_SECTION' #define _MK_ISR_ELEMENT_SECTION(counter) _MK_ISR_SECTION_NAME(irq, __FILE__, counter) ^~~~~~~~~~~~~~~~~~~~~~~~~ include/zephyr/sw_isr_table.h:195:2: note: expanded from macro '_MK_ISR_SECTION_NAME' "." Z_STRINGIFY(prefix) "." file "." Z_STRINGIFY(counter) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Tom Hughes <tomhughes@chromium.org>
1 parent e362f14 commit 2c851d9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

include/zephyr/sw_isr_table.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,10 @@ extern struct z_shared_isr_table_entry z_shared_sw_isr_table[];
211211
#define Z_ISR_DECLARE_C(irq, flags, func, param, counter) \
212212
_Z_ISR_DECLARE_C(irq, flags, func, param, counter)
213213

214-
#define _Z_ISR_DECLARE_C(irq, flags, func, param, counter) \
215-
_Z_ISR_TABLE_ENTRY(irq, func, param, _MK_ISR_ELEMENT_SECTION(counter)); \
216-
static Z_DECL_ALIGN(struct _isr_list_sname) Z_GENERIC_SECTION(.intList) \
217-
__used _MK_ISR_NAME(func, counter) = \
218-
{irq, flags, _MK_ISR_ELEMENT_SECTION(counter)}
214+
#define _Z_ISR_DECLARE_C(irq, flags, func, param, counter) \
215+
_Z_ISR_TABLE_ENTRY(irq, func, param, _MK_ISR_ELEMENT_SECTION(counter)); \
216+
static Z_DECL_ALIGN(struct _isr_list_sname) Z_GENERIC_SECTION(.intList) __used \
217+
_MK_ISR_NAME(func, counter) = {irq, flags, {_MK_ISR_ELEMENT_SECTION(counter)}}
219218

220219
/* Create an entry for _isr_table to be then placed by the linker.
221220
* An instance of struct _isr_list which gets put in the .intList

0 commit comments

Comments
 (0)