LWN.net Logo

rearrange netdevice structure to save space

From:  Stephen Hemminger <shemminger@osdl.org>
To:  "David S. Miller" <davem@davemloft.net>
Subject:  [PATCH] rearrange netdevice structure to save space
Date:  Wed, 9 Mar 2005 09:26:28 -0800
Cc:  netdev@oss.sgi.com
Archive-link:  Article, Thread

Trivial reordering of netdevice structure to save four bytes.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h
--- a/include/linux/netdevice.h	2005-03-09 09:04:56 -08:00
+++ b/include/linux/netdevice.h	2005-03-09 09:04:56 -08:00
@@ -328,9 +328,7 @@
 	unsigned short		flags;	/* interface flags (a la BSD)	*/
 	unsigned short		gflags;
         unsigned short          priv_flags; /* Like 'flags' but invisible to userspace.
*/
-        unsigned short          unused_alignment_fixer; /* Because we need
priv_flags,
-                                                         * and we want to be 32-bit
aligned.
-                                                         */
+	unsigned short		padded;	/* How much padding added by alloc_netdev() */
 
 	unsigned		mtu;	/* interface MTU value		*/
 	unsigned short		type;	/* interface hardware type	*/
@@ -487,8 +485,6 @@
 
 	/* class/net/name entry */
 	struct class_device	class_dev;
-	/* how much padding had been added by alloc_netdev() */
-	int padded;
 };
 
 #define	NETDEV_ALIGN		32



Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds