On 1/25/2008 9:31 AM, Jan Engelhardt wrote: > On Jan 24 2008 23:09, Greg Kroah-Hartman wrote: >>+#ifdef __BIG_ENDIAN >>+/* Big endian */ >>+ >>+struct toggles { >>+ unsigned enabled:5; /* >>+ * Toggle fields are valid if enabled is 0, >>+ * else A-channels must always be used. >>+ */ >>+ unsigned diag_dl:1; >>+ unsigned mdm_dl:1; >>+ unsigned mdm_ul:1; >>+} __attribute__ ((packed)); > > Probably just me, unsigned int is a good bit more explicit. > The driver may also use a combined struct with > BIG_ENDIAN_BITFIELD/LITTLE_ENDIAN_BIGFIELD (see e.g. linux/ip.h).
I've been told we don't do bitfields anymore in on-the-wire data, on-disk data, userspace ABIs, etc. because their layout is compiler dependent in the end. -- Stefan Richter -=====-==--- ---= ==--= http://arcgraph.de/sr/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/