public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module cleanup (3/5)
@ 2002-08-06 22:51 Roman Zippel
  2002-08-07 23:50 ` Roman Zippel
  0 siblings, 1 reply; 2+ messages in thread
From: Roman Zippel @ 2002-08-06 22:51 UTC (permalink / raw)
  To: linux-kernel, torvalds

Hi,

This patch removes __MODULE_STRING() in favour of __stringify().

diff -ur linux-2.5/include/linux/module.h linux-mod/include/linux/module.h
--- linux-2.5/include/linux/module.h	Thu Aug  1 16:43:07 2002
+++ linux-mod/include/linux/module.h	Thu Aug  1 14:41:01 2002
@@ -10,6 +10,7 @@
 #include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
+#include <linux/stringify.h>
 
 #include <asm/atomic.h>
 
@@ -147,11 +141,6 @@
 	(mod_member_present((mod), can_unload) && (mod)->can_unload	\
 	 ? (mod)->can_unload() : atomic_read(&(mod)->uc.usecount))
 
-/* Indirect stringification.  */
-
-#define __MODULE_STRING_1(x)	#x
-#define __MODULE_STRING(x)	__MODULE_STRING_1(x)
-
 /* Generic inter module communication.
  *
  * NOTE: This interface is intended for small amounts of data that are
@@ -221,12 +210,12 @@
 #define MODULE_PARM(var,type)			\
 const char __module_parm_##var[]		\
 __attribute__((section(".modinfo"))) =		\
-"parm_" __MODULE_STRING(var) "=" type
+"parm_" __stringify(var) "=" type
 
 #define MODULE_PARM_DESC(var,desc)		\
 const char __module_parm_desc_##var[]		\
 __attribute__((section(".modinfo"))) =		\
-"parm_desc_" __MODULE_STRING(var) "=" desc
+"parm_desc_" __stringify(var) "=" desc
 
 /*
  * MODULE_DEVICE_TABLE exports information about devices
@@ -392,7 +394,7 @@
  *         #include <linux/modversions.h>
  *         
  *         #define EXPORT_SYMBOL(var) \
- *          __EXPORT_SYMBOL(var, __MODULE_STRING(__VERSIONED_SYMBOL(var)))
+ *          __EXPORT_SYMBOL(var, __stringify(__VERSIONED_SYMBOL(var)))
  *
  *   The first two lines will in essence include
  *
@@ -468,17 +470,17 @@
 #define _set_ver(sym) sym
 #include <linux/modversions.h>
 
-#define EXPORT_SYMBOL(var)  __EXPORT_SYMBOL(var, __MODULE_STRING(__VERSIONED_SYMBOL(var)))
-#define EXPORT_SYMBOL_GPL(var)  __EXPORT_SYMBOL(var, __MODULE_STRING(__VERSIONED_SYMBOL(var)))
+#define EXPORT_SYMBOL(var)  __EXPORT_SYMBOL(var, __stringify(__VERSIONED_SYMBOL(var)))
+#define EXPORT_SYMBOL_GPL(var)  __EXPORT_SYMBOL(var, __stringify(__VERSIONED_SYMBOL(var)))
 
 #else /* !defined (CONFIG_MODVERSIONS) || defined(MODULE) */
 
-#define EXPORT_SYMBOL(var)  __EXPORT_SYMBOL(var, __MODULE_STRING(var))
-#define EXPORT_SYMBOL_GPL(var)  __EXPORT_SYMBOL_GPL(var, __MODULE_STRING(var))
+#define EXPORT_SYMBOL(var)  __EXPORT_SYMBOL(var, __stringify(var))
+#define EXPORT_SYMBOL_GPL(var)  __EXPORT_SYMBOL_GPL(var, __stringify(var))
 
 #endif /* defined(CONFIG_MODVERSIONS) && !defined(MODULE) */
 
-#define EXPORT_SYMBOL_NOVERS(var)  __EXPORT_SYMBOL(var, __MODULE_STRING(var))
+#define EXPORT_SYMBOL_NOVERS(var)  __EXPORT_SYMBOL(var, __stringify(var))
 
 #endif /* __GENKSYMS__ */
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] module cleanup (3/5)
  2002-08-06 22:51 [PATCH] module cleanup (3/5) Roman Zippel
@ 2002-08-07 23:50 ` Roman Zippel
  0 siblings, 0 replies; 2+ messages in thread
From: Roman Zippel @ 2002-08-07 23:50 UTC (permalink / raw)
  To: linux-kernel, torvalds

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Hi,

I wrote:

> This patch removes __MODULE_STRING() in favour of __stringify().

Unfortunately too much code still uses it, so here is a small follow up
patch to add a compatibility define.

bye, Roman

[-- Attachment #2: string.diff --]
[-- Type: text/plain, Size: 342 bytes --]

--- linux/include/linux/module.h.org	Thu Aug  8 01:41:46 2002
+++ linux/include/linux/module.h	Thu Aug  8 01:42:37 2002
@@ -130,6 +130,7 @@
 /* Backwards compatibility definition.  */
 
 #define GET_USE_COUNT(module)	(atomic_read(&(module)->uc.usecount))
+#define __MODULE_STRING(x)	__stringify(x)
 
 /* Poke the use count of a module.  */
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-07 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-06 22:51 [PATCH] module cleanup (3/5) Roman Zippel
2002-08-07 23:50 ` Roman Zippel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox