On Wed, 9 Jan 2008 11:01:38 +0100 (CET) Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > On Wed, 9 Jan 2008, Stephen Rothwell wrote: > > On Tue, 08 Jan 2008 22:35:36 -0800 Geoff Levand <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/
pgpJg5SLN9zwh.pgp
Description: PGP signature
_______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev