Paolo Bonzini <pbonz...@redhat.com> writes: > 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).
I actually have a "... when != dev = expr" in a few later scripts. Added when I found out that just ... produced a bad change in one case. I meant to update all such ... to carry it, then check the addition doesn't mess up anything, but forgot. Can do it for v2. Thanks!