From fa34a3c58ae7161463aded42e70bd59c212ed9f4 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Mon, 31 Aug 2020 17:07:36 -0400 Subject: Use DECLARE_*CHECKER* when possible (--force mode) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separate run of the TypeCheckMacro converter using the --force flag, for the cases where typedefs weren't found in the same header nor in typedefs.h. Generated initially using: $ ./scripts/codeconverter/converter.py --force -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Then each case was manually reviewed, and a comment was added indicating what's unusual about those type checking macros/functions. Despite not following the usual pattern, the changes in this patch were found to be safe. Reviewed-by: Daniel P. Berrangé Signed-off-by: Eduardo Habkost Message-Id: <20200831210740.126168-15-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/intc/arm_gic.h | 9 +++------ include/hw/intc/arm_gicv3.h | 8 +++----- 2 files changed, 6 insertions(+), 11 deletions(-) (limited to 'include/hw/intc') diff --git a/include/hw/intc/arm_gic.h b/include/hw/intc/arm_gic.h index 704ef2b..116ccbb 100644 --- a/include/hw/intc/arm_gic.h +++ b/include/hw/intc/arm_gic.h @@ -74,12 +74,9 @@ #define TYPE_ARM_GIC "arm_gic" typedef struct ARMGICClass ARMGICClass; -#define ARM_GIC(obj) \ - OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC) -#define ARM_GIC_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMGICClass, (klass), TYPE_ARM_GIC) -#define ARM_GIC_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMGICClass, (obj), TYPE_ARM_GIC) +/* This is reusing the GICState typedef from TYPE_ARM_GIC_COMMON */ +DECLARE_OBJ_CHECKERS(GICState, ARMGICClass, + ARM_GIC, TYPE_ARM_GIC) struct ARMGICClass { /*< private >*/ diff --git a/include/hw/intc/arm_gicv3.h b/include/hw/intc/arm_gicv3.h index 58e9131..a81a6ae 100644 --- a/include/hw/intc/arm_gicv3.h +++ b/include/hw/intc/arm_gicv3.h @@ -17,11 +17,9 @@ #define TYPE_ARM_GICV3 "arm-gicv3" typedef struct ARMGICv3Class ARMGICv3Class; -#define ARM_GICV3(obj) OBJECT_CHECK(GICv3State, (obj), TYPE_ARM_GICV3) -#define ARM_GICV3_CLASS(klass) \ - OBJECT_CLASS_CHECK(ARMGICv3Class, (klass), TYPE_ARM_GICV3) -#define ARM_GICV3_GET_CLASS(obj) \ - OBJECT_GET_CLASS(ARMGICv3Class, (obj), TYPE_ARM_GICV3) +/* This is reusing the GICState typedef from TYPE_ARM_GICV3_COMMON */ +DECLARE_OBJ_CHECKERS(GICv3State, ARMGICv3Class, + ARM_GICV3, TYPE_ARM_GICV3) struct ARMGICv3Class { /*< private >*/ -- cgit v1.1