Re: drivers/block/ub.c

From: Oliver Neukum
Date: Sat Jun 26 2004 - 16:57:39 EST


Am Samstag, 26. Juni 2004 23:41 schrieb David S. Miller:
> On Sat, 26 Jun 2004 22:35:15 +0200
> Oliver Neukum <oliver@xxxxxxxxxx> wrote:
>
> >
> > > +/* command block wrapper */
> > > +struct bulk_cb_wrap {
> > > + u32 Signature; /* contains 'USBC' */
> > > + u32 Tag; /* unique per command id */
> > > + u32 DataTransferLength; /* size of data */
> > > + u8 Flags; /* direction in bit 0 */
> > > + u8 Lun; /* LUN normally 0 */
> > > + u8 Length; /* of of the CDB */
> > > + u8 CDB[MAX_CDB_SIZE]; /* max command */
> > > +};
> >
> > should be packed attributed
>
> Only when necessary, and I do not belive any platform Linux supports
> needs it in this case.
>
> Packed attributing is _BAD_ when it isn't needed because it forces GCC
> to output multiple byte-sized loads in order to access larger than
> byte-sized elements because it cannot assume the proper alignment on RISC
> systems.

Unless I am mistaken, this structure is transfered as such over the bus,
so IMHO here it is needed.

Regards
Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/