qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v3] ppc/spapr: Add support for H_SCM_PERFORMANCE_STATS hc


From: Greg Kurz
Subject: Re: [RFC PATCH v3] ppc/spapr: Add support for H_SCM_PERFORMANCE_STATS hcall
Date: Mon, 17 May 2021 09:55:31 +0200

On Mon, 17 May 2021 16:23:56 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Sat, May 15, 2021 at 01:07:59PM +0530, Vaibhav Jain wrote:
[...]
> > +    rc = (result == MEMTX_OK) ?
> > +        scm_perf_check_rr_buffer(perfstats, addr, size, &num_stats) :
> > +        H_PRIVILEGE;
> 
> This is a bit cryptic.  Just deal with the memtx error first, then run
> the buffer validation.  Actually, you can unify the exit paths for
> these and the success case by using a goto label near the end which
> has the g_free() and return rc.
> 

It seems all the g_free() calls could even be avoided by
converting perfstats to g_autofree.

Attachment: pgp1nI6qraag8.pgp
Description: OpenPGP digital signature


reply via email to

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