On 8/14/24 02:52, Peter Maydell wrote:
Define a device_class_set_legacy_reset() function which sets theDeviceClass::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 toDeviceClass::reset to call device_class_set_legacy_reset() instead. Signed-off-by: Peter Maydell<[email protected]> --- 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: Richard Henderson <[email protected]> r~
