[PATCH 1/4] powerpc: Add firmware_set_feature()

Michael Ellerman michael at ellerman.id.au
Thu Jan 12 18:10:35 EST 2006


On Thu, 12 Jan 2006 17:39, David Gibson wrote:
> On Thu, Jan 12, 2006 at 05:09:59PM +1100, Michael Ellerman wrote:
> > +static inline void firmware_set_feature(unsigned long feature)
> > +{
> > +	ppc64_firmware_features |= FW_FEATURE_POSSIBLE & feature;
> > +}
>
> Hrm.. should we really mask here, or just BUG_ON(! (feature &
> FW_FEATURE_POSSIBLE))?

I think we should definitely mask, we don't want to end up with imPOSSIBLE 
features being turned on. BUG_ON might be appropriate, it would at least 
catch people who forget to add features to the POSSIBLE map - is there any 
way to cause it to fail at build time though?

> > -unsigned long ppc64_firmware_features;
> > +unsigned long ppc64_firmware_features = 0;
>
> Kernel convention is generally not to explicitly initialize to zero.
> Doing so forces the variable into .data rather than .bss, and therby
> increases the vmlinux size.  I usually but a /* = 0 */ comment
> instead.

Blergh, gcc can't work that out? I'll fix it to have the comment.

cheers

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060112/8e84ea9d/attachment.pgp 


More information about the Linuxppc64-dev mailing list