Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/cortexm_common: Make cpu.h IWYU clean #21050

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cpu/cortexm_common/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
#ifndef CPU_H
#define CPU_H

#include <stdio.h>

#include "irq.h"
#include "sched.h"
#include "thread.h"
#include "cpu_conf.h"
#include "cpu_conf.h" /* IWYU pragma: export */

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -94,7 +92,7 @@
static inline void cortexm_init_fpu(void)
{
/* initialize the FPU on Cortex-M4F CPUs */
#if (defined(CPU_CORE_CORTEX_M33) || defined(CPU_CORE_CORTEX_M4F) || defined(CPU_CORE_CORTEX_M7)) && defined(MODULE_CORTEXM_FPU)

Check warning on line 95 in cpu/cortexm_common/include/cpu.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
/* give full access to the FPU */
SCB->CPACR |= (uint32_t)CORTEXM_SCB_CPACR_FPU_ACCESS_FULL;
#endif
Expand Down Expand Up @@ -243,7 +241,7 @@
* This function can be used to check for memory size,
* peripherals availability, etc.
*
* @param[in] address Address to check

Check warning on line 244 in cpu/cortexm_common/include/cpu.h

View workflow job for this annotation

GitHub Actions / static-tests

horizontal tab used
* @return true if address is valid
*/
bool cpu_check_address(volatile const char *address);
Expand Down
5 changes: 2 additions & 3 deletions cpu/esp32/periph/gpio_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
#include <assert.h>
#include <errno.h>
#include <stdbool.h>
#include <string.h>

#include "log.h"
#include "irq.h"
#include "periph/gpio_ll.h"

Expand All @@ -39,8 +37,9 @@
#include "esp_idf_api/gpio.h"

#ifdef MODULE_FMT
#include "fmt.h"
# include "fmt.h"
#else
# include <stdio.h>
static inline void print_str(const char *str)
{
fputs(str, stdout);
Expand Down
3 changes: 2 additions & 1 deletion cpu/gd32v/periph/gpio_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
#include "debug.h"

#ifdef MODULE_FMT
#include "fmt.h"
# include "fmt.h"
#else
# include <stdio.h>
static inline void print_str(const char *str)
{
fputs(str, stdout);
Expand Down
3 changes: 2 additions & 1 deletion cpu/nrf5x_common/periph/gpio_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
#include "periph_conf.h"

#ifdef MODULE_FMT
#include "fmt.h"
# include "fmt.h"
#else
# include <stdio.h>
static inline void print_str(const char *str)
{
fputs(str, stdout);
Expand Down
3 changes: 2 additions & 1 deletion cpu/sam0_common/periph/gpio_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
#include "periph/gpio_ll.h"

#ifdef MODULE_FMT
#include "fmt.h"
# include "fmt.h"
#else
# include <stdio.h>
static inline void print_str(const char *str)
{
fputs(str, stdout);
Expand Down
3 changes: 2 additions & 1 deletion cpu/stm32/periph/gpio_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
#include "periph/gpio_ll.h"

#ifdef MODULE_FMT
#include "fmt.h"
# include "fmt.h"
#else
# include <stdio.h>
static inline void print_str(const char *str)
{
fputs(str, stdout);
Expand Down
5 changes: 2 additions & 3 deletions drivers/periph_common/gpio_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* directory for more details.
*/

#include <stdio.h>

#include "periph/gpio_ll.h"

/* Optimizing for low stack usage by not using printf(), which on newlib is
Expand All @@ -19,8 +17,9 @@
* printf().
*/
#ifdef MODULE_FMT
#include "fmt.h"
# include "fmt.h"
#else
# include <stdio.h>
static inline void print_str(const char *str)
{
fputs(str, stdout);
Expand Down
2 changes: 2 additions & 0 deletions examples/pio_blink/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "board.h"
#include "periph/pio.h"

#include <stdio.h>

/* see blink.c */
pio_program_t pio_blink_export_program(void);

Expand Down
2 changes: 2 additions & 0 deletions pkg/openwsn/include/openwsn_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#ifndef OPENWSN_LOG_H
#define OPENWSN_LOG_H

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -67,11 +69,11 @@
#define LOG(level, ...) do { \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wtautological-compare\"") \
if ((level) <= LOG_LEVEL) log_write((level), __VA_ARGS__); } while (0U) \

Check warning on line 72 in pkg/openwsn/include/openwsn_log.h

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
_Pragma("clang diagnostic pop")
#else
#define LOG(level, ...) do { \
if ((level) <= LOG_LEVEL) log_write((level), __VA_ARGS__); } while (0U)

Check warning on line 76 in pkg/openwsn/include/openwsn_log.h

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
#endif /* __clang__ */

/**
Expand Down