qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: xiaoguangrong.eric@gmail.com, mst@redhat.com,
	aneesh.kumar@linux.ibm.com, bharata@linux.vnet.ibm.com,
	qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org,
	shivaprasadbhat@gmail.com, qemu-ppc@nongnu.org,
	imammedo@redhat.com, Vaibhav Jain <vaibhav@linux.ibm.com>,
	ehabkost@redhat.com
Subject: Re: [RFC PATCH v3] ppc/spapr: Add support for H_SCM_PERFORMANCE_STATS hcall
Date: Mon, 17 May 2021 18:16:10 +1000	[thread overview]
Message-ID: <YKImSifcquZgwaUh@yekko> (raw)
In-Reply-To: <20210517095531.6a9502c1@bahia.lan>

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

On Mon, May 17, 2021 at 09:55:31AM +0200, Greg Kurz wrote:
> 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.

That's an even better idea.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-05-17  8:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-15  7:37 [RFC PATCH v3] ppc/spapr: Add support for H_SCM_PERFORMANCE_STATS hcall Vaibhav Jain
2021-05-17  6:23 ` David Gibson
2021-05-17  7:55   ` Greg Kurz
2021-05-17  8:16     ` David Gibson [this message]
2021-05-22  3:31   ` Vaibhav Jain
2021-05-24  7:32     ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKImSifcquZgwaUh@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=groug@kaod.org \
    --cc=imammedo@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=shivaprasadbhat@gmail.com \
    --cc=vaibhav@linux.ibm.com \
    --cc=xiaoguangrong.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).