2004-11-29 23:49:29

by Jesper Juhl

[permalink] [raw]
Subject: [PATCH] net/via-rhine: convert MODULE_PARM to module_param

Hi,

These warnings told me that it was time to move to module_param() :)

drivers/net/via-rhine.c:229: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
drivers/net/via-rhine.c:230: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
drivers/net/via-rhine.c:231: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)

So I made this small patch to do so.
Compile and boot tested on my box, and it seems to work just fine, the
module works perfectly with my via-rhine card, and the parameters are
exposed through sysfs as expected :

juhl@dragon:~$ ls -l /sys/module/via_rhine/parameters/*
-rw-r--r-- 1 root root 0 2004-11-30 00:51 /sys/module/via_rhine/parameters/debug
-r--r--r-- 1 root root 0 2004-11-30 00:50 /sys/module/via_rhine/parameters/max_interrupt_work
-r--r--r-- 1 root root 4096 2004-11-30 00:50 /sys/module/via_rhine/parameters/rx_copybreak

juhl@dragon:~$ cat /sys/module/via_rhine/parameters/debug
1
juhl@dragon:~$ cat /sys/module/via_rhine/parameters/max_interrupt_work
20
juhl@dragon:~$ cat /sys/module/via_rhine/parameters/rx_copybreak
0


Signed-off-by: Jesper Juhl <[email protected]>

diff -up linux-2.6.10-rc2-bk13-orig/drivers/net/via-rhine.c linux-2.6.10-rc2-bk13/drivers/net/via-rhine.c
--- linux-2.6.10-rc2-bk13-orig/drivers/net/via-rhine.c 2004-11-17 01:19:51.000000000 +0100
+++ linux-2.6.10-rc2-bk13/drivers/net/via-rhine.c 2004-11-30 00:16:36.000000000 +0100
@@ -226,9 +226,9 @@ MODULE_AUTHOR("Donald Becker <becker@scy
MODULE_DESCRIPTION("VIA Rhine PCI Fast Ethernet driver");
MODULE_LICENSE("GPL");

-MODULE_PARM(max_interrupt_work, "i");
-MODULE_PARM(debug, "i");
-MODULE_PARM(rx_copybreak, "i");
+module_param(max_interrupt_work, int, 0444);
+module_param(debug, int, 0644);
+module_param(rx_copybreak, int, 0444);
MODULE_PARM_DESC(max_interrupt_work, "VIA Rhine maximum events handled per interrupt");
MODULE_PARM_DESC(debug, "VIA Rhine debug level (0-7)");
MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames");



2004-11-30 14:03:14

by Roger Luethi

[permalink] [raw]
Subject: Re: [PATCH] net/via-rhine: convert MODULE_PARM to module_param

On Tue, 30 Nov 2004 00:58:58 +0100, Jesper Juhl wrote:
> These warnings told me that it was time to move to module_param() :)
>
> drivers/net/via-rhine.c:229: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
> drivers/net/via-rhine.c:230: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
> drivers/net/via-rhine.c:231: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
>
> So I made this small patch to do so.
> Compile and boot tested on my box, and it seems to work just fine, the
> module works perfectly with my via-rhine card, and the parameters are
> exposed through sysfs as expected :

IIRC Jeff has already queued such a patch for 2.6.11. Thanks, though.

Roger

2004-11-30 21:35:11

by Jesper Juhl

[permalink] [raw]
Subject: Re: [PATCH] net/via-rhine: convert MODULE_PARM to module_param

On Tue, 30 Nov 2004, Roger Luethi wrote:

> On Tue, 30 Nov 2004 00:58:58 +0100, Jesper Juhl wrote:
> > These warnings told me that it was time to move to module_param() :)
> >
> > drivers/net/via-rhine.c:229: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
> > drivers/net/via-rhine.c:230: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
> > drivers/net/via-rhine.c:231: warning: `MODULE_PARM_' is deprecated (declared at include/linux/module.h:562)
> >
> > So I made this small patch to do so.
> > Compile and boot tested on my box, and it seems to work just fine, the
> > module works perfectly with my via-rhine card, and the parameters are
> > exposed through sysfs as expected :
>
> IIRC Jeff has already queued such a patch for 2.6.11.

Hmm, ok. I assume that's what's currently in -mm - I haven't been
following -mm lately so I missed the fact that the driver in there had
already moved to module_param(). There's one difference though, and I
think it matters; my patch sets the permission bits so that the parameters
get exposed in sysfs (which I think is very useful), the driver in -mm
sets the perms to 0 (zero) so nothing is exposed in sysfs (less useful).

>Thanks, though.

You are very welcome.


--
Jesper Juhl


2004-11-30 22:04:10

by Roger Luethi

[permalink] [raw]
Subject: Re: [PATCH] net/via-rhine: convert MODULE_PARM to module_param

On Tue, 30 Nov 2004 22:44:37 +0100, Jesper Juhl wrote:
> already moved to module_param(). There's one difference though, and I
> think it matters; my patch sets the permission bits so that the parameters
> get exposed in sysfs (which I think is very useful), the driver in -mm
> sets the perms to 0 (zero) so nothing is exposed in sysfs (less useful).

I am not familiar with the issue. Can you work out with the submitter of
the -mm patch why it was coded that way, and if your version is better?

Roger