All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Linux 2.4.25-pre7
Date: Mon, 26 Jan 2004 16:54:21 +1100	[thread overview]
Message-ID: <20040126165421.679327f0.rusty@rustcorp.com.au> (raw)
In-Reply-To: <Pine.LNX.4.58L.0401231652020.19820@logos.cnet>

On Fri, 23 Jan 2004 16:58:24 -0200 (BRST)
Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
> Here goes -pre number 7 of 2.4.25 series.

Any chance of the forward-compatible module_param patch?

Name: 2.4 module_param Forward Compatibility Macros
Author: Rusty Russell
Status: Tested on 2.5.24-pre6
Version: 2.4

D: Simple uses of module_param() (implemented in 2.6) can be mapped
D: onto the old MODULE_PARM macros.
D: 
D: New code should use module_param() because:
D: 1) Types are checked,
D: 2) Existence of parameters are checked,
D: 3) Customized types are possible [1]
D: 4) Customized set/get routines are possible [1]
D: 5) Parameters appear as boot params with prefix "<modname>." [1]
D: 6) Optional viewing and control through sysfs [2]
D: 
D: [1] Not for 2.4 compatibility macros
D: [2] Not in 2.6.1 or 2.4, and only if third arg non-zero.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .25425-linux-2.4.25-pre6/include/linux/moduleparam.h .25425-linux-2.4.25-pre6.updated/include/linux/moduleparam.h
--- .25425-linux-2.4.25-pre6/include/linux/moduleparam.h	1970-01-01 10:00:00.000000000 +1000
+++ .25425-linux-2.4.25-pre6.updated/include/linux/moduleparam.h	2004-01-21 14:24:41.000000000 +1100
@@ -0,0 +1,25 @@
+#ifndef _LINUX_MODULE_PARAMS_H
+#define _LINUX_MODULE_PARAMS_H
+/* Macros for (very simple) module parameter compatibility with 2.6. */
+#include <linux/module.h>
+
+/* type is byte, short, ushort, int, uint, long, ulong, bool. (2.6
+   has more, but they are not supported).  perm is permissions when
+   it appears in sysfs: 0 means doens't appear, 0444 means read-only
+   by everyone, 0644 means changable dynamically by root, etc.  name
+   must be in scope (unlike MODULE_PARM).
+*/
+#define module_param(name, type, perm)					     \
+	static inline void *__check_existence_##name(void) { return &name; } \
+	MODULE_PARM(name, _MODULE_PARM_STRING_ ## type)
+
+#define _MODULE_PARM_STRING_byte "b"
+#define _MODULE_PARM_STRING_short "h"
+#define _MODULE_PARM_STRING_ushort "h"
+#define _MODULE_PARM_STRING_int "i"
+#define _MODULE_PARM_STRING_uint "i"
+#define _MODULE_PARM_STRING_long "l"
+#define _MODULE_PARM_STRING_ulong "l"
+#define _MODULE_PARM_STRING_bool "i"
+
+#endif /* _LINUX_MODULE_PARAM_TYPES_H */


-- 
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy

  parent reply	other threads:[~2004-01-26  6:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-23 18:58 Linux 2.4.25-pre7 Marcelo Tosatti
2004-01-23 20:04 ` Udo A. Steinberg
2004-01-23 23:36   ` Marcelo Tosatti
2004-01-23 22:34 ` Rafał 'rmrmg' Roszak
2004-01-23 22:52   ` Rafał 'rmrmg' Roszak
2004-01-24 11:21 ` Eyal Lebedinsky
2004-01-24 16:49   ` Yoichi Yuasa
2004-01-25  0:28     ` Eyal Lebedinsky
2004-01-25  1:37       ` Yoichi Yuasa
2004-01-25  0:51     ` Eyal Lebedinsky
2004-01-25  1:45       ` Yoichi Yuasa
2004-01-25  9:03 ` Linux 2.4.25-pre7 - no DRQ after issuing WRITE Gabor Z. Papp
2004-01-25 19:20   ` Marcelo Tosatti
2004-01-25 19:33     ` Gabor Z. Papp
2004-02-07  9:39       ` Gabor Z. Papp
2004-01-26  5:54 ` Rusty Russell [this message]
2004-01-27 19:46   ` Linux 2.4.25-pre7 Marcelo Tosatti
     [not found] ` <200402021700.50301.bzolnier@elka.pw.edu.pl>
     [not found]   ` <x68yjiq2vr@gzp>
2004-02-04 15:52     ` Linux 2.4.25-pre7 - no DRQ after issuing WRITE Bartlomiej Zolnierkiewicz

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=20040126165421.679327f0.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.