On Wednesday 21 November 2012 12:57:59 David Miller wrote:
From: Antonio Quartulli ordex@autistici.org Date: Wed, 21 Nov 2012 13:11:59 +0100
+#pragma pack(2)
...
-} __packed;
The __packed attribute is an abstraction of the actual syntax the compiler uses, if it is supported at all.
Therefore, you can't just unconditionally use the #pragma, and you would need to use some kind of similar compiler abstraction for it.
But to be honest this is really ugly and for very little, if any, gain.
Agree. But we should get this message also to the other guys
$ git grep pragma -- drivers/net drivers/net/bonding/bond_3ad.h:#pragma pack(1) drivers/net/bonding/bond_3ad.h:#pragma pack() drivers/net/bonding/bond_3ad.h:#pragma pack(8) drivers/net/bonding/bond_3ad.h:#pragma pack() drivers/net/bonding/bond_alb.c:#pragma pack(1) drivers/net/bonding/bond_alb.c:#pragma pack() drivers/net/ethernet/brocade/bna/bfa_defs.h:#pragma pack(1) drivers/net/ethernet/brocade/bna/bfa_defs.h:#pragma pack() drivers/net/ethernet/brocade/bna/bfa_defs_cna.h:#pragma pack(1) drivers/net/ethernet/brocade/bna/bfa_defs_cna.h:#pragma pack() drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h:#pragma pack(1) drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h:#pragma pack() drivers/net/ethernet/brocade/bna/bfi.h:#pragma pack(1) drivers/net/ethernet/brocade/bna/bfi.h:#pragma pack() drivers/net/ethernet/brocade/bna/bfi_cna.h:#pragma pack(1) drivers/net/ethernet/brocade/bna/bfi_cna.h:#pragma pack() drivers/net/ethernet/brocade/bna/bfi_enet.h:#pragma pack(1) drivers/net/ethernet/brocade/bna/bfi_enet.h:#pragma pack() drivers/net/ethernet/brocade/bna/cna.h:#pragma pack(1) drivers/net/ethernet/brocade/bna/cna.h:#pragma pack() drivers/net/ethernet/qlogic/qla3xxx.h:#pragma pack(1) drivers/net/ethernet/qlogic/qla3xxx.h:#pragma pack() drivers/net/wan/farsync.c:#pragma pack(1) drivers/net/wan/farsync.c:#pragma pack()
Kind regards, Sven