On 1/30/24 02:44, Philippe Mathieu-Daudé wrote:
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<zhao1....@intel.com>
Signed-off-by: Philippe Mathieu-Daudé<phi...@linaro.org>
---

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to