mtd/include/linux/mtd compatmac.h,1.52,1.53

David Woodhouse dwmw2 at infradead.org
Fri May 16 20:24:27 EDT 2003


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv12592

Modified Files:
	compatmac.h 
Log Message:
fix try__module_get and module_put for built-in case

Index: compatmac.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/compatmac.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- compatmac.h	17 May 2003 00:22:35 -0000	1.52
+++ compatmac.h	17 May 2003 00:24:24 -0000	1.53
@@ -598,9 +598,9 @@
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,60)
-#define try_module_get(m) ({ __MOD_INC_USE_COUNT(m), 1; })
+#define try_module_get(m) ({ ({if (m) __MOD_INC_USE_COUNT((struct module *)(m));}),1; })
 #define __module_get(m) ({ ({if (m) __MOD_INC_USE_COUNT((struct module *)(m));}),1; })
-#define module_put(m) do { __MOD_DEC_USE_COUNT(m); } while(0)
+#define module_put(m) do { if (m) __MOD_DEC_USE_COUNT((struct module *)(m)); } while(0)
 #define set_module_owner(x) do { x->owner = THIS_MODULE; } while(0)
 #endif
 




More information about the linux-mtd-cvs mailing list