[PATCH] hw/nmi: Fix the NMI() macro, based on INTERFACE_CHECK()

Philippe Mathieu-Daudé posted 1 patch 4 years, 4 months ago
Test asan passed
Test checkpatch passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20191207094823.20707-1-philmd@redhat.com
include/hw/nmi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] hw/nmi: Fix the NMI() macro, based on INTERFACE_CHECK()
Posted by Philippe Mathieu-Daudé 4 years, 4 months ago
There is no declaration of the 'NMI' type. INTERFACE_CHECK()
returns an abstract type (see commit aa1b35b975d8). The abstract
type corresponding to the TYPE_NMI interface is 'NMIState'.

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

diff --git a/include/hw/nmi.h b/include/hw/nmi.h
index a1e128724e..fe37ce3ad8 100644
--- a/include/hw/nmi.h
+++ b/include/hw/nmi.h
@@ -31,7 +31,7 @@
 #define NMI_GET_CLASS(obj) \
     OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI)
 #define NMI(obj) \
-     INTERFACE_CHECK(NMI, (obj), TYPE_NMI)
+     INTERFACE_CHECK(NMIState, (obj), TYPE_NMI)
 
 typedef struct NMIState NMIState;
 
-- 
2.21.0


Re: [PATCH] hw/nmi: Fix the NMI() macro, based on INTERFACE_CHECK()
Posted by Gavin Shan 4 years, 4 months ago
On 12/7/19 8:48 PM, Philippe Mathieu-Daudé wrote:
> There is no declaration of the 'NMI' type. INTERFACE_CHECK()
> returns an abstract type (see commit aa1b35b975d8). The abstract
> type corresponding to the TYPE_NMI interface is 'NMIState'.
> 
> Fixes: 9cb805fd267
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---

Reviewed-by: Gavin Shan <gshan@redhat.com>

>   include/hw/nmi.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/nmi.h b/include/hw/nmi.h
> index a1e128724e..fe37ce3ad8 100644
> --- a/include/hw/nmi.h
> +++ b/include/hw/nmi.h
> @@ -31,7 +31,7 @@
>   #define NMI_GET_CLASS(obj) \
>       OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI)
>   #define NMI(obj) \
> -     INTERFACE_CHECK(NMI, (obj), TYPE_NMI)
> +     INTERFACE_CHECK(NMIState, (obj), TYPE_NMI)
>   
>   typedef struct NMIState NMIState;
>   
> 


Re: [PATCH] hw/nmi: Fix the NMI() macro, based on INTERFACE_CHECK()
Posted by Eduardo Habkost 4 years, 4 months ago
On Sun, Dec 08, 2019 at 12:44:16AM +1100, Gavin Shan wrote:
> On 12/7/19 8:48 PM, Philippe Mathieu-Daudé wrote:
> > There is no declaration of the 'NMI' type. INTERFACE_CHECK()
> > returns an abstract type (see commit aa1b35b975d8). The abstract
> > type corresponding to the TYPE_NMI interface is 'NMIState'.
> > 
> > Fixes: 9cb805fd267
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> 
> Reviewed-by: Gavin Shan <gshan@redhat.com>

Queued, thanks!

-- 
Eduardo