Skip to contentSkip to conversation

kill open-coded offsetof in cm4000_cs.c ZERO_DEV()

PATCH Applied Al Viro 2 participants 2 messages Jun 15, 2006 – Jun 30, 2006 Char and misc drivers

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 kill open-coded offsetof in cm4000_cs.c ZERO_DEV()

... to make sure that it doesn't break again when a field changes (see "[PATCH] pcmcia: fix zeroing of cm4000_cs.c data" for recent example).

---

 drivers/char/pcmcia/cm4000_cs.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

e9defe1ea51dd92069e68d3b32ac55ca73b06b53

drivers/char/pcmcia/cm4000_cs.c +1 -6
index eab5394..31c8a21 100644
@@ -149,12 +149,7 @@ struct cm4000_dev {
 #define	ZERO_DEV(dev)  						\
 	memset(&dev->atr_csum,0,				\
 		sizeof(struct cm4000_dev) - 			\
-		/*link*/ sizeof(struct pcmcia_device *) - 	\
-		/*node*/ sizeof(dev_node_t) - 			\
-		/*atr*/ MAX_ATR*sizeof(char) - 			\
-		/*rbuf*/ 512*sizeof(char) - 			\
-		/*sbuf*/ 512*sizeof(char) - 			\
-		/*queue*/ 4*sizeof(wait_queue_head_t))
+		offsetof(struct cm4000_dev, atr_csum))
 
 static struct pcmcia_device *dev_table[CM4000_MAX_DEV];
 static struct class *cmm_class;
Signature · 1 line
1.3.GIT
#1 lore raw
Quoted 2 lines · Al Viro

... to make sure that it doesn't break again when a field changes (see "[PATCH] pcmcia: fix zeroing of cm4000_cs.c data" for recent example).

Applied.

Thanks,
Dominik