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

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

 



On Mon, 17 May 2021 16:23:56 +1000
David Gibson <david@xxxxxxxxxxxxxxxxxxxxx> 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: pgpIs9GcSemAv.pgp
Description: OpenPGP digital signature


[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux