diff mbox series

[for-6.2,08/12] npcm7xx_clk: Use DECLARE_INSTANCE_CHECKER

Message ID 20210806211127.646908-9-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show
Series qom: Get rid of all manual usage of OBJECT_CHECK & friends | expand

Commit Message

Eduardo Habkost Aug. 6, 2021, 9:11 p.m. UTC
Use DECLARE_INSTANCE_CHECKER instead of defining the
NPCM7XX_CLOCK_PLL, NPCM7XX_CLOCK_SEL, and NPCM7XX_CLOCK_DIVIDER
macros manually.

These changes had to be done manually because the codeconverter
script isn't smart enough to figure out that the typedefs exist
in a separate header.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Havard Skinnemoen <hskinnemoen@google.com>
Cc: Tyrone Ting <kfting@nuvoton.com>
Cc: qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org
---
 hw/misc/npcm7xx_clk.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Philippe Mathieu-Daudé Aug. 7, 2021, 7:59 a.m. UTC | #1
On 8/6/21 11:11 PM, Eduardo Habkost wrote:
> Use DECLARE_INSTANCE_CHECKER instead of defining the
> NPCM7XX_CLOCK_PLL, NPCM7XX_CLOCK_SEL, and NPCM7XX_CLOCK_DIVIDER
> macros manually.
> 
> These changes had to be done manually because the codeconverter
> script isn't smart enough to figure out that the typedefs exist
> in a separate header.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: Havard Skinnemoen <hskinnemoen@google.com>
> Cc: Tyrone Ting <kfting@nuvoton.com>
> Cc: qemu-arm@nongnu.org
> Cc: qemu-devel@nongnu.org
> ---
>  hw/misc/npcm7xx_clk.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff mbox series

Patch

diff --git a/hw/misc/npcm7xx_clk.c b/hw/misc/npcm7xx_clk.c
index da6b14c545d..5247acfeb5a 100644
--- a/hw/misc/npcm7xx_clk.c
+++ b/hw/misc/npcm7xx_clk.c
@@ -110,14 +110,14 @@  static const uint32_t cold_reset_values[NPCM7XX_CLK_NR_REGS] = {
 /* Clock converter functions */
 
 #define TYPE_NPCM7XX_CLOCK_PLL "npcm7xx-clock-pll"
-#define NPCM7XX_CLOCK_PLL(obj) OBJECT_CHECK(NPCM7xxClockPLLState, \
-        (obj), TYPE_NPCM7XX_CLOCK_PLL)
+DECLARE_INSTANCE_CHECKER(NPCM7xxClockPLLState, NPCM7XX_CLOCK_PLL,
+                         TYPE_NPCM7XX_CLOCK_PLL)
 #define TYPE_NPCM7XX_CLOCK_SEL "npcm7xx-clock-sel"
-#define NPCM7XX_CLOCK_SEL(obj) OBJECT_CHECK(NPCM7xxClockSELState, \
-        (obj), TYPE_NPCM7XX_CLOCK_SEL)
+DECLARE_INSTANCE_CHECKER(NPCM7xxClockSELState, NPCM7XX_CLOCK_SEL,
+                         TYPE_NPCM7XX_CLOCK_SEL)
 #define TYPE_NPCM7XX_CLOCK_DIVIDER "npcm7xx-clock-divider"
-#define NPCM7XX_CLOCK_DIVIDER(obj) OBJECT_CHECK(NPCM7xxClockDividerState, \
-        (obj), TYPE_NPCM7XX_CLOCK_DIVIDER)
+DECLARE_INSTANCE_CHECKER(NPCM7xxClockDividerState, NPCM7XX_CLOCK_DIVIDER,
+                         TYPE_NPCM7XX_CLOCK_DIVIDER)
 
 static void npcm7xx_clk_update_pll(void *opaque)
 {