On 19/05/20 16:55, Markus Armbruster wrote:
>     expression bus, type_name, dev;
>     @@
>     -    dev = qdev_create(bus, type_name);
>     +    dev = qdev_new(type_name);
>          ...
>     -    qdev_init_nofail(dev);
>     +    qdev_realize_and_unref(dev, bus, &error_fatal);
> 

> The first rule exempts hw/arm/highbank.c, because it matches along two
> control flow paths there, with different @type_name.  Covered by the
> next commit's manual conversions.

Slightly better way to express it:

     expression bus, type_name, dev;
     @@
     -    dev = qdev_create(bus, type_name);
     +    dev = qdev_new(type_name);
          ... when != dev = qdev_create(...)
     -    qdev_init_nofail(dev);
     +    qdev_realize_and_unref(dev, bus, &error_fatal);

(Just for documentation purposes, the patch is okay of course).

Paolo


Reply via email to