qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-9.2 07/10] hw: Define new device_class_set_legacy_reset()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH for-9.2 07/10] hw: Define new device_class_set_legacy_reset()
Date: Mon, 26 Aug 2024 18:06:24 +0200
User-agent: Mozilla Thunderbird

On 13/8/24 18:52, Peter Maydell wrote:
Define a device_class_set_legacy_reset() function which
sets the DeviceClass::reset field. This serves two purposes:
  * it makes it clearer to the person writing code that
    DeviceClass::reset is now legacy and they should look for
    the new alternative (which is Resettable)
  * it makes it easier to rename the reset field (which in turn
    makes it easier to find places that call it)

The Coccinelle script can be used to automatically convert code that
was doing an open-coded assignment to DeviceClass::reset to call
device_class_set_legacy_reset() instead.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  scripts/coccinelle/device-reset.cocci | 30 +++++++++++++++++++++++++++
  include/hw/qdev-core.h                | 13 ++++++++++++
  hw/core/qdev.c                        |  5 +++++
  3 files changed, 48 insertions(+)
  create mode 100644 scripts/coccinelle/device-reset.cocci

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]