[PATCH] qom/object: Remove circular include dependency

Philippe Mathieu-Daudé posted 1 patch 1 year, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220509084659.52076-1-philippe.mathieu.daude@gmail.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>
include/qom/object.h | 1 -
1 file changed, 1 deletion(-)
[PATCH] qom/object: Remove circular include dependency
Posted by Philippe Mathieu-Daudé 1 year, 11 months ago
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

"qom/object.h" doesn't need to include itself.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/qom/object.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index 5f3d5b5bf5..ef7258a5e1 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -16,7 +16,6 @@
 
 #include "qapi/qapi-builtin-types.h"
 #include "qemu/module.h"
-#include "qom/object.h"
 
 struct TypeImpl;
 typedef struct TypeImpl *Type;
-- 
2.35.1


Re: [PATCH] qom/object: Remove circular include dependency
Posted by Laurent Vivier 1 year, 10 months ago
Le 09/05/2022 à 10:46, Philippe Mathieu-Daudé a écrit :
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> "qom/object.h" doesn't need to include itself.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   include/qom/object.h | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/include/qom/object.h b/include/qom/object.h
> index 5f3d5b5bf5..ef7258a5e1 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -16,7 +16,6 @@
>   
>   #include "qapi/qapi-builtin-types.h"
>   #include "qemu/module.h"
> -#include "qom/object.h"
>   
>   struct TypeImpl;
>   typedef struct TypeImpl *Type;

Applied to my trivial-patches branch.

Thanks,
Laurent


Re: [PATCH] qom/object: Remove circular include dependency
Posted by Markus Armbruster 1 year, 11 months ago
Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> writes:

> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> "qom/object.h" doesn't need to include itself.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/qom/object.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/include/qom/object.h b/include/qom/object.h
> index 5f3d5b5bf5..ef7258a5e1 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -16,7 +16,6 @@
>  
>  #include "qapi/qapi-builtin-types.h"
>  #include "qemu/module.h"
> -#include "qom/object.h"
>  
>  struct TypeImpl;
>  typedef struct TypeImpl *Type;

I figure this is scripts/codeconverter/converter.py's doing, in commit
db1015e92e "Move QOM typedefs and add missing includes".  Probably not
worth fixing there.  Possibly worth mentioning in the commit message.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Re: [PATCH] qom/object: Remove circular include dependency
Posted by Peter Maydell 1 year, 11 months ago
On Mon, 9 May 2022 at 09:53, Philippe Mathieu-Daudé
<philippe.mathieu.daude@gmail.com> wrote:
>
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> "qom/object.h" doesn't need to include itself.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/qom/object.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/include/qom/object.h b/include/qom/object.h
> index 5f3d5b5bf5..ef7258a5e1 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -16,7 +16,6 @@
>
>  #include "qapi/qapi-builtin-types.h"
>  #include "qemu/module.h"
> -#include "qom/object.h"
>
>  struct TypeImpl;
>  typedef struct TypeImpl *Type;

Accidentally (but harmlessly) added in commit db1015e92e0483 by a
change generated by a script.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Eduardo: is it worth making ./scripts/codeconverter/converter.py
handle this as a special case, so it doesn't add the include line
to qom/object.h itself ? Or do we not really expect that script
to be run on the codebase again in future ?

thanks
-- PMM
Re: [PATCH] qom/object: Remove circular include dependency
Posted by Philippe Mathieu-Daudé via 1 year, 11 months ago
On 9/5/22 11:41, Peter Maydell wrote:
> On Mon, 9 May 2022 at 09:53, Philippe Mathieu-Daudé
> <philippe.mathieu.daude@gmail.com> wrote:
>>
>> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>
>> "qom/object.h" doesn't need to include itself.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>   include/qom/object.h | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/include/qom/object.h b/include/qom/object.h
>> index 5f3d5b5bf5..ef7258a5e1 100644
>> --- a/include/qom/object.h
>> +++ b/include/qom/object.h
>> @@ -16,7 +16,6 @@
>>
>>   #include "qapi/qapi-builtin-types.h"
>>   #include "qemu/module.h"
>> -#include "qom/object.h"
>>
>>   struct TypeImpl;
>>   typedef struct TypeImpl *Type;
> 
> Accidentally (but harmlessly) 

This makes crash clang tools such clang-format, I'll amend that
to the description.

> added in commit db1015e92e0483 by a
> change generated by a script.
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> 
> Eduardo: is it worth making ./scripts/codeconverter/converter.py
> handle this as a special case, so it doesn't add the include line
> to qom/object.h itself ? Or do we not really expect that script
> to be run on the codebase again in future ?

Oh, I see required_identifiers() adding this include in
scripts/codeconverter/codeconverter/qom_macros.py.

If we do not expect to use these scripts, we should remove it from
the repository. They are in good shape however, and might be still
valuable, so I'll amend a fix to the script.

Thanks for pointing at these scripts,

Phil.

Re: [PATCH] qom/object: Remove circular include dependency
Posted by Peter Maydell 1 year, 11 months ago
On Mon, 9 May 2022 at 13:44, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 9/5/22 11:41, Peter Maydell wrote:
> > Accidentally (but harmlessly)
>
> This makes crash clang tools such clang-format, I'll amend that
> to the description.

That sounds like a bug in clang-format :-)

-- PMM
Re: [PATCH] qom/object: Remove circular include dependency
Posted by Damien Hedde 1 year, 11 months ago

On 5/9/22 10:46, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> "qom/object.h" doesn't need to include itself.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
> ---
>   include/qom/object.h | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/include/qom/object.h b/include/qom/object.h
> index 5f3d5b5bf5..ef7258a5e1 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -16,7 +16,6 @@
>   
>   #include "qapi/qapi-builtin-types.h"
>   #include "qemu/module.h"
> -#include "qom/object.h"
>   
>   struct TypeImpl;
>   typedef struct TypeImpl *Type;