[PATCH v3 1/9] riscv/boot: Add a missing header include

Alistair Francis posted 9 patches 5 years, 7 months ago
Maintainers: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Alistair Francis <Alistair.Francis@wdc.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>
There is a newer version of this series
[PATCH v3 1/9] riscv/boot: Add a missing header include
Posted by Alistair Francis 5 years, 7 months ago
Currently every c file that includes boot.h also includes loader.h
before it. Which is why the build works fine. We should be able to
include just boot.h though so this is a small fixup to allow that.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
---
 include/hw/riscv/boot.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
index 474a940ad5..9daa98da08 100644
--- a/include/hw/riscv/boot.h
+++ b/include/hw/riscv/boot.h
@@ -21,6 +21,7 @@
 #define RISCV_BOOT_H
 
 #include "exec/cpu-defs.h"
+#include "hw/loader.h"
 
 void riscv_find_and_load_firmware(MachineState *machine,
                                   const char *default_machine_firmware,
-- 
2.26.2


Re: [PATCH v3 1/9] riscv/boot: Add a missing header include
Posted by Philippe Mathieu-Daudé 5 years, 7 months ago
On 5/19/20 11:31 PM, Alistair Francis wrote:
> Currently every c file that includes boot.h also includes loader.h
> before it. Which is why the build works fine. We should be able to
> include just boot.h though so this is a small fixup to allow that.

What about:

'As the functions declared in this header use the symbol_fn_t
  typedef itself declared in "hw/loader.h", we need to include
  it here to make the header file self-contained.'

> 
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Reviewed-by: Bin Meng <bin.meng@windriver.com>
> ---
>   include/hw/riscv/boot.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
> index 474a940ad5..9daa98da08 100644
> --- a/include/hw/riscv/boot.h
> +++ b/include/hw/riscv/boot.h
> @@ -21,6 +21,7 @@
>   #define RISCV_BOOT_H
>   
>   #include "exec/cpu-defs.h"
> +#include "hw/loader.h"
>   
>   void riscv_find_and_load_firmware(MachineState *machine,
>                                     const char *default_machine_firmware,
> 


Re: [PATCH v3 1/9] riscv/boot: Add a missing header include
Posted by Alistair Francis 5 years, 7 months ago
On Tue, May 19, 2020 at 11:01 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 5/19/20 11:31 PM, Alistair Francis wrote:
> > Currently every c file that includes boot.h also includes loader.h
> > before it. Which is why the build works fine. We should be able to
> > include just boot.h though so this is a small fixup to allow that.
>
> What about:
>
> 'As the functions declared in this header use the symbol_fn_t
>   typedef itself declared in "hw/loader.h", we need to include
>   it here to make the header file self-contained.'

Sounds good.

Alistair

>
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > Reviewed-by: Bin Meng <bin.meng@windriver.com>
> > ---
> >   include/hw/riscv/boot.h | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/include/hw/riscv/boot.h b/include/hw/riscv/boot.h
> > index 474a940ad5..9daa98da08 100644
> > --- a/include/hw/riscv/boot.h
> > +++ b/include/hw/riscv/boot.h
> > @@ -21,6 +21,7 @@
> >   #define RISCV_BOOT_H
> >
> >   #include "exec/cpu-defs.h"
> > +#include "hw/loader.h"
> >
> >   void riscv_find_and_load_firmware(MachineState *machine,
> >                                     const char *default_machine_firmware,
> >
>