mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@home-tj.org>
To: rusty@rustcorp.com.au, mochel@osdl.org, greg@kroah.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.10-rc1 9/15] driver-model: parse_args()'s @unknown function modified to take void *arg
Date: Thu, 4 Nov 2004 15:50:16 +0900	[thread overview]
Message-ID: <20041104065016.GI24890@home-tj.org> (raw)
In-Reply-To: <20041104063532.GA24566@home-tj.org>

 dp_09_module_param_unknown_arg.patch

 This is the 9th patch of 15 patches for devparam.

 The @unknown function of parse_args() is changed to take a void *arg.
This is used by devparam.


Signed-off-by: Tejun Heo <tj@home-tj.org>


Index: linux-export/include/linux/moduleparam.h
===================================================================
--- linux-export.orig/include/linux/moduleparam.h	2004-11-04 14:25:59.000000000 +0900
+++ linux-export/include/linux/moduleparam.h	2004-11-04 14:25:59.000000000 +0900
@@ -114,7 +114,8 @@ extern int parse_args(const char *name,
 		      char *args,
 		      struct kernel_param *params,
 		      unsigned num,
-		      int (*unknown)(char *param, char *val));
+		      int (*unknown)(char *param, char *val, void *arg),
+		      void *uarg);
 
 /* All the helper functions */
 /* The macros to do compile-time type checking stolen from Jakub
Index: linux-export/init/main.c
===================================================================
--- linux-export.orig/init/main.c	2004-11-04 10:25:56.000000000 +0900
+++ linux-export/init/main.c	2004-11-04 14:25:59.000000000 +0900
@@ -284,7 +284,7 @@ __setup("quiet", quiet_kernel);
  * Unknown boot options get handed to init, unless they look like
  * failed parameters
  */
-static int __init unknown_bootoption(char *param, char *val)
+static int __init unknown_bootoption(char *param, char *val, void *arg)
 {
 	/* Change NUL term back to "=", to make "param" the whole string. */
 	if (val) {
@@ -450,7 +450,7 @@ static void noinline rest_init(void)
 } 
 
 /* Check for early params. */
-static int __init do_early_param(char *param, char *val)
+static int __init do_early_param(char *param, char *val, void *arg)
 {
 	struct obs_kernel_param *p;
 	extern struct obs_kernel_param __setup_start, __setup_end;
@@ -477,7 +477,7 @@ void __init parse_early_param(void)
 
 	/* All fall through to do_early_param. */
 	strlcpy(tmp_cmdline, saved_command_line, COMMAND_LINE_SIZE);
-	parse_args("early options", tmp_cmdline, NULL, 0, do_early_param);
+	parse_args("early options", tmp_cmdline, NULL, 0, do_early_param, NULL);
 	done = 1;
 }
 
@@ -517,7 +517,7 @@ asmlinkage void __init start_kernel(void
 	parse_early_param();
 	parse_args("Booting kernel", command_line, __start___param,
 		   __stop___param - __start___param,
-		   &unknown_bootoption);
+		   &unknown_bootoption, NULL);
 	sort_main_extable();
 	trap_init();
 	rcu_init();
Index: linux-export/kernel/module.c
===================================================================
--- linux-export.orig/kernel/module.c	2004-11-04 14:25:58.000000000 +0900
+++ linux-export/kernel/module.c	2004-11-04 14:25:59.000000000 +0900
@@ -807,7 +807,7 @@ static int obsolete_params(const char *n
 		kp[i].arg = &obsparm[i];
 	}
 
-	ret = parse_args(name, args, kp, num, NULL);
+	ret = parse_args(name, args, kp, num, NULL, NULL);
  out:
 	kfree(kp);
 	return ret;
@@ -1716,7 +1716,7 @@ static struct module *load_module(void _
 				 sechdrs[setupindex].sh_addr,
 				 sechdrs[setupindex].sh_size
 				 / sizeof(struct kernel_param),
-				 NULL);
+				 NULL, NULL);
 	}
 	err = mod_sysfs_setup(mod, 
 			      (struct kernel_param *)
Index: linux-export/kernel/params.c
===================================================================
--- linux-export.orig/kernel/params.c	2004-11-04 14:25:59.000000000 +0900
+++ linux-export/kernel/params.c	2004-11-04 14:25:59.000000000 +0900
@@ -50,7 +50,8 @@ static int parse_one(char *param,
 		     char *val,
 		     struct kernel_param *params, 
 		     unsigned num_params,
-		     int (*handle_unknown)(char *param, char *val))
+		     int (*handle_unknown)(char *param, char *val, void *arg),
+		     void *uarg)
 {
 	unsigned int i;
 
@@ -65,7 +66,7 @@ static int parse_one(char *param,
 
 	if (handle_unknown) {
 		DEBUGP("Unknown argument: calling %p\n", handle_unknown);
-		return handle_unknown(param, val);
+		return handle_unknown(param, val, uarg);
 	}
 
 	DEBUGP("Unknown argument `%s'\n", param);
@@ -120,7 +121,7 @@ int parse_args(const char *name,
 	       char *args,
 	       struct kernel_param *params,
 	       unsigned num,
-	       int (*unknown)(char *param, char *val))
+	       int (*unknown)(char *param, char *val, void *arg), void *uarg)
 {
 	char *param, *val;
 
@@ -130,7 +131,7 @@ int parse_args(const char *name,
 		int ret;
 
 		args = param_next_arg(args, &param, &val);
-		ret = parse_one(param, val, params, num, unknown);
+		ret = parse_one(param, val, params, num, unknown, uarg);
 		switch (ret) {
 		case -ENOENT:
 			printk(KERN_ERR "%s: Unknown parameter `%s'\n",

  parent reply	other threads:[~2004-11-04  6:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04  6:35 [PATCH 2.6.10-rc1 0/15] driver-model: per-device parameter, round 3 Tejun Heo
2004-11-04  6:38 ` [PATCH 2.6.10-rc1 1/15] driver-model: param_array_set num field fix Tejun Heo
2004-11-04  6:39 ` [PATCH 2.6.10-rc1 2/15] driver-model: flag type helpers added to moduleparam Tejun Heo
2004-11-04  6:40 ` [PATCH 2.6.10-rc1 3/15] driver-model: Tejun Heo
2004-11-04  6:44 ` [PATCH 2.6.10-rc1 4/15] driver-model: const qualifier removed from @val of param_array() Tejun Heo
2004-11-04  6:45 ` [PATCH 2.6.10-rc1 5/15] driver-model: param_array_delims() implemented Tejun Heo
2004-11-04  6:47 ` [PATCH 2.6.10-rc1 6/15] driver-model: ':' added to default param_array delimiters Tejun Heo
2004-11-04  6:48 ` [PATCH 2.6.10-rc1 7/15] driver-model: next_arg() renamed to param_next_arg() and became global Tejun Heo
2004-11-04  6:49 ` [PATCH 2.6.10-rc1 8/15] driver-model: MODULE_PARAM_PREFIX is changed to empty string from nothing Tejun Heo
2004-11-04  6:50 ` Tejun Heo [this message]
2004-11-04  6:51 ` [PATCH 2.6.10-rc1 10/15] driver-model: module_param_array() changed back to accept variable name directly for @num and module_param_arr() added Tejun Heo
2004-11-04  6:52 ` [PATCH 2.6.10-rc1 11/15] driver-model: module_param_array/arr() change applied Tejun Heo
2004-11-04  6:53 ` [PATCH 2.6.10-rc1 12/15] driver-model: devparam implemented Tejun Heo
2004-11-04  6:53 ` [PATCH 2.6.10-rc1 13/15] driver-model: devparam applied Tejun Heo
2004-11-04  6:54 ` [PATCH 2.6.10-rc1 14/15] driver-model: devparam documentation Tejun Heo
2004-11-04  6:54 ` [PATCH 2.6.10-rc1 15/15] driver-model: via-velocity converted to use devparam Tejun Heo

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=20041104065016.GI24890@home-tj.org \
    --to=tj@home-tj.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®