public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: two 2.5 modules bugs
Date: Mon, 30 Dec 2002 17:13:07 +1100	[thread overview]
Message-ID: <20021230061405.9D0742C252@lists.samba.org> (raw)
In-Reply-To: Your message of "Sun, 29 Dec 2002 21:18:21 BST." <200212292018.VAA25446@harpo.it.uu.se>

In message <200212292018.VAA25446@harpo.it.uu.se> you write:
> >long".  The obvious fix (untested) is:
> >
> Tested. This patch makes the parport_pc module work again. Thanks.

Linus, please apply.  Mikael, thanks for the excellent bug report!

Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Fix MODULE_PARM for arrays of s.
Author: Rusty Russell
Status: Tested on 2.5.53 (by Mikael Pettersson)

D: I interpreted "1-10s" to mean a string of 1-10 chars.  It actually
D: means 1-10 comma-separated strings.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .748-linux-2.5-bk/kernel/module.c .748-linux-2.5-bk.updated/kernel/module.c
--- .748-linux-2.5-bk/kernel/module.c	2002-12-30 15:30:15.000000000 +1100
+++ .748-linux-2.5-bk.updated/kernel/module.c	2002-12-30 17:11:37.000000000 +1100
@@ -569,20 +569,6 @@ static int param_set_byte(const char *va
 	return 0;
 }
 
-static int param_string(const char *name, const char *val,
-			unsigned int min, unsigned int max,
-			char *dest)
-{
-	if (strlen(val) < min || strlen(val) > max) {
-		printk(KERN_ERR
-		       "Parameter %s length must be %u-%u characters\n",
-		       name, min, max);
-		return -EINVAL;
-	}
-	strcpy(dest, val);
-	return 0;
-}
-
 extern int set_obsolete(const char *val, struct kernel_param *kp)
 {
 	unsigned int min, max;
@@ -618,7 +604,8 @@ extern int set_obsolete(const char *val,
 		return param_array(kp->name, val, min, max, obsparm->addr,
 				   sizeof(long), param_set_long);
 	case 's':
-		return param_string(kp->name, val, min, max, obsparm->addr);
+		return param_array(kp->name, val, min, max, obsparm->addr,
+				   sizeof(char *), param_set_charp);
 	}
 	printk(KERN_ERR "Unknown obsolete parameter type %s\n", obsparm->type);
 	return -EINVAL;

  reply	other threads:[~2002-12-30  6:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-29 20:18 two 2.5 modules bugs Mikael Pettersson
2002-12-30  6:13 ` Rusty Russell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-12-30 11:39 Rusty Russell
2002-12-27 16:16 Mikael Pettersson
2002-12-27 23:24 ` Petr Vandrovec
2002-12-28 10:37 ` Rusty Russell

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=20021230061405.9D0742C252@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    --cc=torvalds@transmeta.com \
    /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