[PATCH] PPC64 iSeries: cleanup viopath
Stephen Rothwell
sfr at canb.auug.org.au
Wed Mar 16 02:53:39 EST 2005
On Tue, 15 Mar 2005 08:32:27 -0600 Hollis Blanchard <hollis at penguinppc.org> wrote:
>
> On Mar 14, 2005, at 9:34 PM, Stephen Rothwell wrote:
> >
> > Since you brought this file to my attention, I figured I might as well
> > do
> > some simple cleanups. This patch does:
> > - single bit int bitfields are a bit suspect and Anndrew pointed
> > out recently that they are probably slower to access than ints
>
> > --- linus/arch/ppc64/kernel/viopath.c 2005-03-13 04:07:42.000000000
> > +1100
> > +++ linus-cleanup.1/arch/ppc64/kernel/viopath.c 2005-03-15
> > 14:02:48.000000000 +1100
> > @@ -56,8 +57,8 @@
> > * But this allows for other support in the future.
> > */
> > static struct viopathStatus {
> > - int isOpen:1; /* Did we open the path? */
> > - int isActive:1; /* Do we have a mon msg outstanding */
> > + int isOpen; /* Did we open the path? */
> > + int isActive; /* Do we have a mon msg outstanding */
> > int users[VIO_MAX_SUBTYPES];
> > HvLpInstanceId mSourceInst;
> > HvLpInstanceId mTargetInst;
>
> Why not use a byte instead of a full int (reordering the members for
> alignment)?
Because "classical" boleans are ints.
Because I don't know the relative speed of accessing single byte variables.
Because it was easy.
Because we only allocate 32 of these structures. Changing them really
only adds four bytes per structure. I guess using bytes and rearranging
the structure could actually save 4 bytes per structure.
I originally changed them to unsigned int single bit bitfields, but
changed my mind - would that be better?
It really makes little difference, I was just trying to get rid of the
silly signed single bit bitfields ...
--
Cheers,
Stephen Rothwell sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- 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/20050316/205a4051/attachment.pgp
More information about the Linuxppc64-dev
mailing list