Re: [PATCH 1/2] New Omnikey Cardman 4040 driver

From: Andrew Morton
Date: Wed Sep 14 2005 - 04:20:46 EST


Harald Welte <laforge@xxxxxxxxxxxx> wrote:
>
> Add new Omnikey Cardman 4040 smartcard reader driver
>

I see a timer, but I see no del_timer_sync() anywhere. Cannot the timer be
left pending after device shutdown or rmmod?

Plus:


- Work around gcc-2.95.x macro expansion bug

- unneded void* cast

- use kzalloc()


diff -puN drivers/char/pcmcia/cm4040_cs.c~new-omnikey-cardman-4040-driver-fixes drivers/char/pcmcia/cm4040_cs.c
--- devel/drivers/char/pcmcia/cm4040_cs.c~new-omnikey-cardman-4040-driver-fixes 2005-09-14 02:05:46.000000000 -0700
+++ devel-akpm/drivers/char/pcmcia/cm4040_cs.c 2005-09-14 02:05:46.000000000 -0700
@@ -46,7 +46,7 @@ module_param(pc_debug, int, 0600);
#define DEBUGP(n, rdr, x, args...) do { \
if (pc_debug >= (n)) \
dev_printk(KERN_DEBUG, reader_to_dev(rdr), "%s:" x, \
- __FUNCTION__, ##args); \
+ __FUNCTION__ , ##args); \
} while (0)
#else
#define DEBUGP(n, rdr, x, args...)
@@ -453,7 +453,7 @@ static int cm4040_open(struct inode *ino
if (link->open)
return -EBUSY;

- dev = (struct reader_dev *)link->priv;
+ dev = link->priv;
filp->private_data = dev;

if (filp->f_flags & O_NONBLOCK) {
@@ -705,11 +705,10 @@ static dev_link_t *reader_attach(void)
if (i == CM_MAX_DEV)
return NULL;

- dev = kmalloc(sizeof(struct reader_dev), GFP_KERNEL);
+ dev = kzalloc(sizeof(struct reader_dev), GFP_KERNEL);
if (dev == NULL)
return NULL;

- memset(dev, 0, sizeof(struct reader_dev));
dev->timeout = CCID_DRIVER_MINIMUM_TIMEOUT;
dev->buffer_status = 0;

_

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