On 10/06/2017 06:49 PM, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> > --- > qapi/opts-visitor.c | 2 +- > qapi/qapi-clone-visitor.c | 2 +- > qapi/qapi-dealloc-visitor.c | 2 +- > qapi/qobject-output-visitor.c | 2 +- > qapi/string-input-visitor.c | 2 +- > qapi/string-output-visitor.c | 2 +- > 6 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c > index 324b197495..34ac49f3c2 100644 > --- a/qapi/opts-visitor.c > +++ b/qapi/opts-visitor.c > @@ -539,7 +539,7 @@ opts_visitor_new(const QemuOpts *opts) > OptsVisitor *ov; > > assert(opts); > - ov = g_malloc0(sizeof *ov); > + ov = g_new0(OptsVisitor, 1);
Transformations like this are harder to justify - you have more typing rather than less, and no change in the amount of type-safety. If we really want to convert LHS = g_malloc0(sizeof(*LHS)), we probably ought to have a stronger justification (consistency might be such an argument, if the entire series is applied and HACKING is updated to mention our new preferred style, and where the checked-in Coccinelle script can be easily re-run in the future to catch regressions). Converting LHS = g_malloc0(sizeof(type)) is a no-brainer, because it DOES add type-safety, and often results in less typing. But I haven't looked at your entire series to see which patches fall in the no-brainer category vs. the weakly-argued consistency category. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature