[patch 2/4 v2] PS3: Add logical performance monitor repository routines

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Wed Jan 9 21:01:38 EST 2008


On Wed, 9 Jan 2008, Stephen Rothwell wrote:
> On Tue, 08 Jan 2008 22:35:36 -0800 Geoff Levand <geoffrey.levand at 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.

> > +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.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven at sonycom.com
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619


More information about the Linuxppc-dev mailing list