public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 8/9] introduce __obsolete_setup
Date: Sun, 29 Feb 2004 02:02:09 -0500	[thread overview]
Message-ID: <200402290202.11245.dtor_core@ameritech.net> (raw)
In-Reply-To: <200402290201.15611.dtor_core@ameritech.net>


===================================================================


ChangeSet@1.1692, 2004-02-28 00:49:41-05:00, dtor_core@ameritech.net
  Setup: introduce __obsolete_setup macro to denote truly obsolete
         parameters. Whenever such parameter is specified kernel
         will comlain that "Parameter %s is obsolete, ignored"


 include/linux/init.h |   22 +++++++++++++++++-----
 init/main.c          |    7 +++++--
 2 files changed, 22 insertions(+), 7 deletions(-)


===================================================================



diff -Nru a/include/linux/init.h b/include/linux/init.h
--- a/include/linux/init.h	Sun Feb 29 01:19:55 2004
+++ b/include/linux/init.h	Sun Feb 29 01:19:55 2004
@@ -110,12 +110,21 @@
 };
 
 /* OBSOLETE: see moduleparam.h for the right way. */
-#define __setup(str, fn)					\
-	static char __setup_str_##fn[] __initdata = str;	\
-	static struct obs_kernel_param __setup_##fn		\
+#define __setup_param(str, unique_id, fn)			\
+	static char __setup_str_##unique_id[] __initdata = str;	\
+	static struct obs_kernel_param __setup_##unique_id	\
 		 __attribute_used__				\
 		 __attribute__((__section__(".init.setup")))	\
-		= { __setup_str_##fn, fn }
+		= { __setup_str_##unique_id, fn }
+
+#define __setup_null_param(str, unique_id)			\
+	__setup_param(str, unique_id, NULL)
+
+#define __setup(str, fn)					\
+	__setup_param(str, fn, fn)
+
+#define __obsolete_setup(str)					\
+	__setup_null_param(str, __LINE__)
 
 #endif /* __ASSEMBLY__ */
 
@@ -172,7 +181,10 @@
 	{ return exitfn; }					\
 	void cleanup_module(void) __attribute__((alias(#exitfn)));
 
-#define __setup(str,func) /* nothing */
+#define __setup_param(str, unique_id, fn)	/* nothing */
+#define __setup_null_param(str, unique_id) 	/* nothing */
+#define __setup(str, func) 			/* nothing */
+#define __obsolete_setup(str) 			/* nothing */
 #endif
 
 /* Data marked not to be saved by software_suspend() */
diff -Nru a/init/main.c b/init/main.c
--- a/init/main.c	Sun Feb 29 01:19:55 2004
+++ b/init/main.c	Sun Feb 29 01:19:55 2004
@@ -155,8 +155,11 @@
 	p = &__setup_start;
 	do {
 		int n = strlen(p->str);
-		if (!strncmp(line,p->str,n)) {
-			if (p->setup_func(line+n))
+		if (!strncmp(line, p->str, n)) {
+			if (!p->setup_func) {
+				printk(KERN_WARNING "Parameter %s is obsolete, ignored\n", p->str);
+				return 1;
+			} else if (p->setup_func(line + n))
 				return 1;
 		}
 		p++;

  reply	other threads:[~2004-02-29  7:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-29  6:53 [PATCH 0/9] New set of input patches Dmitry Torokhov
2004-02-29  6:55 ` [PATCH 1/9] atkbd whitespace fixes Dmitry Torokhov
2004-02-29  6:55   ` [PATCH 2/9] atkbd bad merge Dmitry Torokhov
2004-02-29  6:56     ` [PATCH 3/9] synaptics strict/relaxed protocol checks Dmitry Torokhov
2004-02-29  6:58       ` [PATCH 4/9] psmouse whitespace fixes Dmitry Torokhov
2004-02-29  6:58         ` [PATCH 5/9] psmouse broken hardware workaround Dmitry Torokhov
2004-02-29  7:00           ` [PATCH 6/9] introduce module_param_array_named Dmitry Torokhov
2004-02-29  7:01             ` [PATCH 7/9] Move joysticks to the module_param way of handling options Dmitry Torokhov
2004-02-29  7:02               ` Dmitry Torokhov [this message]
2004-02-29  7:03                 ` [PATCH 9/9] Document removed input options using __obsolete_setup Dmitry Torokhov
2004-03-02 13:02 ` [PATCH 0/9] New set of input patches Vojtech Pavlik
2004-03-02 17:45   ` Dmitry Torokhov
2004-03-02 23:56     ` bkbits hosting (was Re: [PATCH 0/9] New set of input patches) Andy Isaacson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200402290202.11245.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox