[PATCH] hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string

Philippe Mathieu-Daudé posted 1 patch 4 years ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200428154650.21991-1-f4bug@amsat.org
hw/arm/mps2-tz.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string
Posted by Philippe Mathieu-Daudé 4 years ago
By using the TYPE_* definitions for devices, we can:
 - quickly find where devices are used with 'git-grep'
 - easily rename a device (one-line change).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/arm/mps2-tz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index a8dea7dde1..2c43041564 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -395,7 +395,7 @@ static void mps2tz_common_init(MachineState *machine)
         exit(EXIT_FAILURE);
     }
 
-    sysbus_init_child_obj(OBJECT(machine), "iotkit", &mms->iotkit,
+    sysbus_init_child_obj(OBJECT(machine), TYPE_IOTKIT, &mms->iotkit,
                           sizeof(mms->iotkit), mmc->armsse_type);
     iotkitdev = DEVICE(&mms->iotkit);
     object_property_set_link(OBJECT(&mms->iotkit), OBJECT(system_memory),
-- 
2.21.1


Re: [PATCH] hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string
Posted by Peter Maydell 4 years ago
On Tue, 28 Apr 2020 at 16:46, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> By using the TYPE_* definitions for devices, we can:
>  - quickly find where devices are used with 'git-grep'
>  - easily rename a device (one-line change).
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/arm/mps2-tz.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)



Applied to target-arm.next, thanks.

-- PMM