[PATCH 12/15] kill open-coded offsetof in cm4000_cs.c ZERO_DEV()
Dominik Brodowski
linux at dominikbrodowski.net
Fri Jun 30 16:01:11 EDT 2006
From: Al Viro <viro at ftp.linux.org.uk>
Date: Thu, 15 Jun 2006 12:26:55 +0100
Subject: [PATCH] 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).
Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
drivers/char/pcmcia/cm4000_cs.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index eab5394..31c8a21 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -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;
--
1.4.0
More information about the linux-pcmcia
mailing list