OSDN Git Service

hw/m68k/next-cube: Do not open-code sysbus_create_simple()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 24 Oct 2023 08:30:08 +0000 (10:30 +0200)
committerThomas Huth <huth@tuxfamily.org>
Wed, 1 Nov 2023 06:20:34 +0000 (07:20 +0100)
commitb2897f7ed446aedf2e5ed33762ac823db13c2f56
tree795a2d9c3b13c7e787d6e7092f2c042f92ab94c8
parent4c4ee593d636dc462b6fe15e00c31d6ff6c72bd0
hw/m68k/next-cube: Do not open-code sysbus_create_simple()

Mechanical change using the following coccinelle script:

  @@
  identifier dev;
  identifier sbd;
  expression qom_type;
  expression addr;
  @@
  -    dev = qdev_new(qom_type);
  -    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
  -    sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr);
  +    dev = sysbus_create_simple(qom_type, addr, NULL);

then manually removing the 'dev' variable to avoid:

  error: variable 'dev' set but not used [-Werror,-Wunused-but-set-variable]

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Message-ID: <20231024083010.12453-6-philmd@linaro.org>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
hw/m68k/next-cube.c