The RAMBLOCK_FOREACH_MIGRATABLE() macro, defined in
migration/ram.h, ends up calling QLIST_FOREACH_RCU()
which always assigns its iterator variable when entering
the loop. Remove the pointless and possibly misleading
assignment.
Mechanical patch using the following coccinelle spatch:
@@
type T;
identifier e;
iterator FOREACH_MACRO =~ ".*_FOREACH.*";
statement S;
@@
- T *e = ...;
+ T *e;
... when != e
FOREACH_MACRO(e, ...) S
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-Id: <
20260415215539.92629-6-philmd@linaro.org>
{
struct RamblockDirtyInfo *info = NULL;
struct RamblockDirtyInfo *dinfo = NULL;
- RAMBlock *block = NULL;
+ RAMBlock *block;
int total_count = 0;
int index = 0;
bool ret = false;
int block_count)
{
struct RamblockDirtyInfo *block_dinfo = NULL;
- RAMBlock *block = NULL;
+ RAMBlock *block;
RAMBLOCK_FOREACH_MIGRATABLE(block) {
if (skip_sample_ramblock(block)) {