mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
cocci: Do not initialize variable used by QSIMPLEQ_FOREACH macro
The QSIMPLEQ_FOREACH() macro, defined in "qemu/queue.h",
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-4-philmd@linaro.org>
This commit is contained in:
@@ -591,7 +591,7 @@ static int coroutine_fn rule_check(BlockDriverState *bs, uint64_t offset,
|
||||
uint64_t bytes, BlkdebugIOType iotype)
|
||||
{
|
||||
BDRVBlkdebugState *s = bs->opaque;
|
||||
BlkdebugRule *rule = NULL;
|
||||
BlkdebugRule *rule;
|
||||
int error;
|
||||
bool immediately;
|
||||
|
||||
|
||||
@@ -1216,7 +1216,7 @@ fail:
|
||||
static int dirty_bitmap_save_setup(QEMUFile *f, void *opaque, Error **errp)
|
||||
{
|
||||
DBMSaveState *s = &((DBMState *)opaque)->save;
|
||||
SaveBitmapState *dbms = NULL;
|
||||
SaveBitmapState *dbms;
|
||||
|
||||
if (init_dirty_bitmap_migration(s, errp) < 0) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user