[Qemu-devel] [PATCH] hw/ppc/spapr: Use the proper include that defines 'target_ulong'

Philippe Mathieu-Daudé posted 1 patch 6 years, 2 months ago
Test docker-clang@ubuntu passed
Test FreeBSD passed
Test asan failed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190819144926.5297-1-philmd@redhat.com
Maintainers: David Gibson <david@gibson.dropbear.id.au>
include/hw/ppc/spapr_ovec.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] hw/ppc/spapr: Use the proper include that defines 'target_ulong'
Posted by Philippe Mathieu-Daudé 6 years, 2 months ago
As its name implies, the Option/Architecture Vector is not target
(per cpu) specific but arch-related.
Use the proper arch-related header, allowing to use this header
with non cpu-specific objects.

This fixes this error when using this header with $common-obj:

  include/hw/ppc/spapr_ovec.h:76:44: error: unknown type name ‘target_ulong’; did you mean ‘gulong’?
     SpaprOptionVector *spapr_ovec_parse_vector(target_ulong table_addr, int vector);
                                                ^~~~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/hw/ppc/spapr_ovec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h
index 7891e9caac..b6b8811998 100644
--- a/include/hw/ppc/spapr_ovec.h
+++ b/include/hw/ppc/spapr_ovec.h
@@ -37,7 +37,7 @@
 #ifndef SPAPR_OVEC_H
 #define SPAPR_OVEC_H
 
-#include "cpu.h"
+#include "exec/cpu-defs.h"
 
 typedef struct SpaprOptionVector SpaprOptionVector;
 
-- 
2.20.1


Re: [Qemu-devel] [PATCH] hw/ppc/spapr: Use the proper include that defines 'target_ulong'
Posted by David Gibson 6 years, 2 months ago
On Mon, Aug 19, 2019 at 04:49:26PM +0200, Philippe Mathieu-Daudé wrote:
> As its name implies, the Option/Architecture Vector is not target
> (per cpu) specific but arch-related.
> Use the proper arch-related header, allowing to use this header
> with non cpu-specific objects.
> 
> This fixes this error when using this header with $common-obj:
> 
>   include/hw/ppc/spapr_ovec.h:76:44: error: unknown type name ‘target_ulong’; did you mean ‘gulong’?
>      SpaprOptionVector *spapr_ovec_parse_vector(target_ulong table_addr, int vector);
>                                                 ^~~~~~~~~~~~
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

So, the change here seems sane, but the commit message totally
confuses me.  Where does the term "Option/Architecture Vector" come
from?  What distinction are you drawing between per-target and
per-arch?  What's the symptom if this patch is not applied?

> ---
>  include/hw/ppc/spapr_ovec.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h
> index 7891e9caac..b6b8811998 100644
> --- a/include/hw/ppc/spapr_ovec.h
> +++ b/include/hw/ppc/spapr_ovec.h
> @@ -37,7 +37,7 @@
>  #ifndef SPAPR_OVEC_H
>  #define SPAPR_OVEC_H
>  
> -#include "cpu.h"
> +#include "exec/cpu-defs.h"
>  
>  typedef struct SpaprOptionVector SpaprOptionVector;
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson