From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org,
Takashi Yamamoto <TakashiA.Yamamoto@jp.sony.com>
Subject: Re: [patch 2/4 v2] PS3: Add logical performance monitor repository routines
Date: Thu, 10 Jan 2008 08:47:03 +1100 [thread overview]
Message-ID: <20080110084703.9bb09c39.sfr@canb.auug.org.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0801091100470.1492@vixen.sonytel.be>
[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]
On Wed, 9 Jan 2008 11:01:38 +0100 (CET) Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> wrote:
>
> On Wed, 9 Jan 2008, Stephen Rothwell wrote:
> > On Tue, 08 Jan 2008 22:35:36 -0800 Geoff Levand <geoffrey.levand@am.sony.com> wrote:
> > >
> > > +int ps3_repository_read_num_pu(unsigned int *num_pu)
> > > +{
> > > + int result;
> > > + u64 v1;
> > > +
> > > + v1 = 0;
> > > + result = read_node(PS3_LPAR_ID_CURRENT,
> > > + make_first_field("bi", 0),
> > > + make_field("pun", 0),
> > > + 0, 0,
> > > + &v1, NULL);
> > > + *num_pu = v1;
> >
> > Why not just pass "num_pu" instead of &v1 to read_node()?
>
> We need a temporary because num_pu and v1 differ in size.
> The alternative is to make num_pu u64.
Ooops, sorry. I read the second one first and didn't look hard enough
when I came back to this one.
> > > +int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id)
> > > +{
> > > + int result;
> > > + u64 v1;
> > > +
> > > + v1 = 0;
> > > + result = read_node(PS3_LPAR_ID_CURRENT,
> > > + make_first_field("bi", 0),
> > > + make_field("pu", pu_index),
> > > + 0, 0,
> > > + &v1, NULL);
> > > + *pu_id = v1;
> >
> > Similarly with "pu_id"?
>
> Yep, here we don't need the temporary.
Which, of course means that the "result" temporary isn't needed either.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-01-09 21:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-05 3:12 [patch 0/3] PS3 logical performance monitor patches for 2.6.25 Geoff Levand
2008-01-09 6:35 ` [patch 1/4] POWERPC: Add Cell SPRN bookmark register Geoff Levand
2008-01-09 11:55 ` Arnd Bergmann
2008-01-09 6:35 ` [patch 2/4 v2] PS3: Add logical performance monitor repository routines Geoff Levand
2008-01-09 7:15 ` Stephen Rothwell
2008-01-09 10:01 ` Geert Uytterhoeven
2008-01-09 21:47 ` Stephen Rothwell [this message]
2008-01-10 1:01 ` [patch 2/4 v3] " Geoff Levand
2008-01-09 6:35 ` [patch 3/4 v2] PS3: Add logical performance monitor device support Geoff Levand
2008-01-10 1:01 ` [patch 3/4 v3] " Geoff Levand
2008-01-09 6:35 ` [patch 4/4 v2] PS3: Add logical performance monitor driver support Geoff Levand
2008-01-09 10:41 ` Geert Uytterhoeven
2008-01-09 13:20 ` TakashiYamamoto
2008-01-10 1:01 ` [patch 4/4 v3] " Geoff Levand
2008-01-10 9:44 ` Geert Uytterhoeven
2008-01-10 23:39 ` [patch 4/4 v4] " Geoff Levand
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=20080110084703.9bb09c39.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=Geert.Uytterhoeven@sonycom.com \
--cc=TakashiA.Yamamoto@jp.sony.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/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