qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 01/29] bulk: Access existing variables initialized to &S->


From: Richard Henderson
Subject: Re: [PATCH v3 01/29] bulk: Access existing variables initialized to &S->F when available
Date: Tue, 30 Jan 2024 17:56:24 +1000
User-agent: Mozilla Thunderbird

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.liu@intel.com>
Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
---

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

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]