weird padding in linux/timex.h, struct timex

From: Muli Ben-Yehuda (mulix@actcom.co.il)
Date: Tue Aug 06 2002 - 06:15:49 EST


Hi,

struct timex in include/linux/timex.h is defined as

struct timex
{
        ...
        int :32; int :32; int :32; int :32;
        int :32; int :32; int :32; int :32;
        int :32; int :32; int :32; int :32;
};

I assume that this is used as padding. Is there any reason for using
bitfields as padding? If there is, a comment to that effect would be
nice. If there isn't, the following patch makes the padding explicit.

--- 2.4.19-vanilla/include/linux/timex.h Sun Aug 4 19:16:59 2002
+++ 2.4.19-mx/include/linux/timex.h Tue Aug 6 13:49:32 2002
@@ -182,9 +182,7 @@
         long errcnt; /* calibration errors (ro) */
         long stbcnt; /* stability limit exceeded (ro) */
 
- int :32; int :32; int :32; int :32;
- int :32; int :32; int :32; int :32;
- int :32; int :32; int :32; int :32;
+ char __pad[12 * 4]; /* padding */
 };
 
 /*

-- 
I am PINK, hear me ROAR

http://vipe.technion.ac.il/~mulix/ http://syscalltrack.sf.net/


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



This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:31 EST