From 0dfd83938fa388ed43074b8890f9ba20be386f92 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Sat, 23 Nov 2024 10:49:25 +0100 Subject: [PATCH 1/4] {cpu,drivers}/periph_gpio_ll: add missing include For `gpio_ll_print_conf()` we need to include ``, when not using `fmt.h`. --- cpu/esp32/periph/gpio_ll.c | 5 ++--- cpu/gd32v/periph/gpio_ll.c | 3 ++- cpu/nrf5x_common/periph/gpio_ll.c | 3 ++- cpu/sam0_common/periph/gpio_ll.c | 3 ++- cpu/stm32/periph/gpio_ll.c | 3 ++- drivers/periph_common/gpio_ll.c | 5 ++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cpu/esp32/periph/gpio_ll.c b/cpu/esp32/periph/gpio_ll.c index 93146c1d05..81a5e22d1f 100644 --- a/cpu/esp32/periph/gpio_ll.c +++ b/cpu/esp32/periph/gpio_ll.c @@ -24,9 +24,7 @@ #include #include #include -#include -#include "log.h" #include "irq.h" #include "periph/gpio_ll.h" @@ -39,8 +37,9 @@ #include "esp_idf_api/gpio.h" #ifdef MODULE_FMT -#include "fmt.h" +# include "fmt.h" #else +# include static inline void print_str(const char *str) { fputs(str, stdout); diff --git a/cpu/gd32v/periph/gpio_ll.c b/cpu/gd32v/periph/gpio_ll.c index 8a59b1df64..d1d5bf2034 100644 --- a/cpu/gd32v/periph/gpio_ll.c +++ b/cpu/gd32v/periph/gpio_ll.c @@ -28,8 +28,9 @@ #include "debug.h" #ifdef MODULE_FMT -#include "fmt.h" +# include "fmt.h" #else +# include static inline void print_str(const char *str) { fputs(str, stdout); diff --git a/cpu/nrf5x_common/periph/gpio_ll.c b/cpu/nrf5x_common/periph/gpio_ll.c index c556f8ac92..5035a1a079 100644 --- a/cpu/nrf5x_common/periph/gpio_ll.c +++ b/cpu/nrf5x_common/periph/gpio_ll.c @@ -37,8 +37,9 @@ #include "periph_conf.h" #ifdef MODULE_FMT -#include "fmt.h" +# include "fmt.h" #else +# include static inline void print_str(const char *str) { fputs(str, stdout); diff --git a/cpu/sam0_common/periph/gpio_ll.c b/cpu/sam0_common/periph/gpio_ll.c index d375faeda9..f78d798fc9 100644 --- a/cpu/sam0_common/periph/gpio_ll.c +++ b/cpu/sam0_common/periph/gpio_ll.c @@ -45,8 +45,9 @@ #include "periph/gpio_ll.h" #ifdef MODULE_FMT -#include "fmt.h" +# include "fmt.h" #else +# include static inline void print_str(const char *str) { fputs(str, stdout); diff --git a/cpu/stm32/periph/gpio_ll.c b/cpu/stm32/periph/gpio_ll.c index ae2a8c8413..e4561fb813 100644 --- a/cpu/stm32/periph/gpio_ll.c +++ b/cpu/stm32/periph/gpio_ll.c @@ -34,8 +34,9 @@ #include "periph/gpio_ll.h" #ifdef MODULE_FMT -#include "fmt.h" +# include "fmt.h" #else +# include static inline void print_str(const char *str) { fputs(str, stdout); diff --git a/drivers/periph_common/gpio_ll.c b/drivers/periph_common/gpio_ll.c index 30f3209bf0..82e2cadeaf 100644 --- a/drivers/periph_common/gpio_ll.c +++ b/drivers/periph_common/gpio_ll.c @@ -6,8 +6,6 @@ * directory for more details. */ -#include - #include "periph/gpio_ll.h" /* Optimizing for low stack usage by not using printf(), which on newlib is @@ -19,8 +17,9 @@ * printf(). */ #ifdef MODULE_FMT -#include "fmt.h" +# include "fmt.h" #else +# include static inline void print_str(const char *str) { fputs(str, stdout); From f0880b386e8bf930841ee3fc6c7b688e1db309c9 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 27 Nov 2024 09:18:13 +0100 Subject: [PATCH 2/4] pkg/openwsn: add missing include --- pkg/openwsn/include/openwsn_log.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/openwsn/include/openwsn_log.h b/pkg/openwsn/include/openwsn_log.h index 5e0078fc14..ef73c348c4 100644 --- a/pkg/openwsn/include/openwsn_log.h +++ b/pkg/openwsn/include/openwsn_log.h @@ -22,6 +22,8 @@ #ifndef OPENWSN_LOG_H #define OPENWSN_LOG_H +#include + #ifdef __cplusplus extern "C" { #endif From c507ebff43487422e69413ef9b7c35655aae0ff2 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 27 Nov 2024 11:57:04 +0100 Subject: [PATCH 3/4] examples/pio_blink: add missing include --- examples/pio_blink/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/pio_blink/main.c b/examples/pio_blink/main.c index 1a47eb05f3..ccd2dd42bc 100644 --- a/examples/pio_blink/main.c +++ b/examples/pio_blink/main.c @@ -9,6 +9,8 @@ #include "board.h" #include "periph/pio.h" +#include + /* see blink.c */ pio_program_t pio_blink_export_program(void); From faa3727b1ff2f187737654e1e11b793723191091 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 27 Nov 2024 09:04:33 +0100 Subject: [PATCH 4/4] cpu/cortexm_common: Make cpu.h IWYU clean There is clearly no reason `cpu.h` should `#include `. Also add an export pragma to `cpu_conf.h`, as portable code is expected to include `cpu.h` (which exists across MCU families in RIOT), and not `cpu_conf.h` (which only exists for some MCU families). --- cpu/cortexm_common/include/cpu.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cpu/cortexm_common/include/cpu.h b/cpu/cortexm_common/include/cpu.h index 9749778197..e7abdc67f6 100644 --- a/cpu/cortexm_common/include/cpu.h +++ b/cpu/cortexm_common/include/cpu.h @@ -30,12 +30,10 @@ #ifndef CPU_H #define CPU_H -#include - #include "irq.h" #include "sched.h" #include "thread.h" -#include "cpu_conf.h" +#include "cpu_conf.h" /* IWYU pragma: export */ #ifdef __cplusplus extern "C" {