mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-06 11:02:25 -10:00
When a variable is initialized to &struct->field, use it
in place. Rationale: while this makes the code more concise,
this also helps static analyzers.
Mechanical change using the following Coccinelle spatch script:
@@
type S, F;
identifier s, m, v;
@@
S *s;
...
F *v = &s->m;
<+...
- &s->m
+ v
...+>
Inspired-by: Zhao Liu <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-ID: <[email protected]>
Acked-by: Fabiano Rosas <[email protected]>
Reviewed-by: Zhao Liu <[email protected]>
Reviewed-by: Anthony PERARD <[email protected]>
[thuth: Dropped hunks that need a rebase, and fixed sizeof() in pmu_realize()]
Signed-off-by: Thomas Huth <[email protected]>