diff mbox series

[v2,7/9] hw/sh4/r2d: Include missing 'exec/tswap.h' header

Message ID 20241211230357.97036-8-philmd@linaro.org (mailing list archive)
State New
Headers show
Series misc: Reduce 'exec/tswap.h' inclusions | expand

Commit Message

Philippe Mathieu-Daudé Dec. 11, 2024, 11:03 p.m. UTC
r2d.c indirectly get "exec/tswap.h" declarations via
"exec/cpu-all.h". Include it directly to be able to
remove the former from the latter, otherwise we get:

  hw/sh4/r2d.c:357:35: error: call to undeclared function 'tswap32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    357 |         boot_params.loader_type = tswap32(1);
        |                                   ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/sh4/r2d.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Henderson Dec. 12, 2024, 12:02 a.m. UTC | #1
On 12/11/24 17:03, Philippe Mathieu-Daudé wrote:
> r2d.c indirectly get "exec/tswap.h" declarations via
> "exec/cpu-all.h". Include it directly to be able to
> remove the former from the latter, otherwise we get:
> 
>    hw/sh4/r2d.c:357:35: error: call to undeclared function 'tswap32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>      357 |         boot_params.loader_type = tswap32(1);
>          |                                   ^
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/sh4/r2d.c | 1 +
>   1 file changed, 1 insertion(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index 7eecd79fcc1..e6cc156c238 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -43,6 +43,7 @@ 
 #include "hw/loader.h"
 #include "hw/usb.h"
 #include "hw/block/flash.h"
+#include "exec/tswap.h"
 
 #define FLASH_BASE 0x00000000
 #define FLASH_SIZE (16 * MiB)