lkml.org 
[lkml]   [2003]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][ATM] suni_init shouldnt be __init and remove mod inc/dec
exporting a symbol declared as __init is bogus.  additonally, suni
doesnt need to modify its ref counts, to quote:

Q: My code use "MOD_INC_USE_COUNT". Do I still need to adjust my
module count when someone calls one of my functions?
A: No ...
... It could be another module using one of your
EXPORT_SYMBOL'ed functions, in which case you cannot be removed
since they would have to be removed first. ...

this is certainly the case for suni which is used by the various
atm drivers.

Index: linux/drivers/atm/suni.c
===================================================================
RCS file: /home/chas/CVSROOT/linux/drivers/atm/suni.c,v
retrieving revision 1.1
retrieving revision 1.3
diff -u -r1.1 -r1.3
--- linux/drivers/atm/suni.c 20 Feb 2003 13:45:03 -0000 1.1
+++ linux/drivers/atm/suni.c 26 Feb 2003 15:43:30 -0000 1.3
@@ -233,8 +233,6 @@
if (!(PRIV(dev) = kmalloc(sizeof(struct suni_priv),GFP_KERNEL)))
return -ENOMEM;

- MOD_INC_USE_COUNT;
-
PRIV(dev)->dev = dev;
spin_lock_irqsave(&sunis_lock,flags);
first = !sunis;
@@ -280,7 +278,6 @@
spin_unlock_irqrestore(&sunis_lock,flags);
kfree(PRIV(dev));

- MOD_DEC_USE_COUNT;
return 0;
}

@@ -293,7 +290,7 @@
};


-int __init suni_init(struct atm_dev *dev)
+int suni_init(struct atm_dev *dev)
{
unsigned char mri;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.024 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site