qemu/scripts/coccinelle
Peter Maydell aadea887f4 scripts/coccinelle: New script to add ResetType to hold and exit phases
We pass a ResetType argument to the Resettable class enter phase
method, but we don't pass it to hold and exit, even though the
callsites have it readily available.  This means that if a device
cared about the ResetType it would need to record it in the enter
phase method to use later on.  We should pass the type to all three
of the phase methods to avoid having to do that.

This coccinelle script adds the ResetType argument to the hold and
exit phases of the Resettable interface.

The first part of the script (rules holdfn_assigned, holdfn_defined,
exitfn_assigned, exitfn_defined) update implementations of the
interface within device models, both to change the signature of their
method implementations and to pass on the reset type when they invoke
reset on some other device.

The second part of the script is various special cases:
 * method callsites in resettable_phase_hold(), resettable_phase_exit()
   and device_phases_reset()
 * updating the typedefs for the methods
 * isl_pmbus_vr.c has some code where one device's reset method directly
   calls the implementation of a different device's method

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Luc Michel <luc.michel@amd.com>
Message-id: 20240412160809.1260625-4-peter.maydell@linaro.org
2024-04-25 10:21:06 +01:00
..
cpu_restore_state.cocci
cpu-reset.cocci
err-bad-newline.cocci
error_propagate_null.cocci
error-use-after-free.cocci
errp-guard.cocci
exec_rw_const.cocci
inplace-byteswaps.cocci
memory-region-housekeeping.cocci softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate() 2021-06-15 20:27:38 +02:00
overflow_muldiv64.cocci
qobject.cocci
qom-parent-type.cocci qom: fix objects with improper parent type 2020-10-12 11:50:22 -04:00
remove_local_err.cocci
remove_muldiv64.cocci
reset-type.cocci scripts/coccinelle: New script to add ResetType to hold and exit phases 2024-04-25 10:21:06 +01:00
return_directly.cocci cleanup: Tweak and re-run return_directly.cocci 2022-12-14 16:19:35 +01:00
round.cocci
simplify_muldiv64.cocci
swap_muldiv64.cocci
tcg_gen_extract.cocci
timer-del-timer-free.cocci scripts/coccinelle: New script to remove unnecessary timer_del() calls 2021-01-08 15:13:38 +00:00
typecast.cocci
use-error_fatal.cocci
use-g_new-etc.cocci scripts/coccinelle: New use-g_new-etc.cocci 2022-03-21 15:44:44 +01:00