* [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal
@ 2004-02-07 15:37 Michael Veeck
2004-02-07 16:30 ` Jeff Garzik
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Michael Veeck @ 2004-02-07 15:37 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 148 bytes --]
Hi!
Patch (against 2.6.3-rc1) removes unnecessary min/max macros and changes
calls to use kernel.h macros instead.
Feedback always welcome
Michael
[-- Attachment #2: minmax_drivers_net_acenic.patch --]
[-- Type: text/plain, Size: 390 bytes --]
--- linux-2.6.2.org/drivers/net/acenic.c 2004-02-07 15:25:57.000000000 +0100
+++ linux-2.6.2.new/drivers/net/acenic.c 2004-02-07 15:33:24.286033896 +0100
@@ -335,10 +335,6 @@
#define ACE_PROBE_ARG struct net_device *dev
#endif
-#ifndef min_t
-#define min_t(type,a,b) (((a)<(b))?(a):(b))
-#endif
-
#ifndef ARCH_HAS_PREFETCHW
#ifndef prefetchw
#define prefetchw(x) do{} while(0)
[-- Attachment #3: Type: text/plain, Size: 163 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal
2004-02-07 15:37 [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal Michael Veeck
@ 2004-02-07 16:30 ` Jeff Garzik
2004-02-07 17:35 ` Michael Veeck
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Jeff Garzik @ 2004-02-07 16:30 UTC (permalink / raw)
To: kernel-janitors
Michael Veeck wrote:
> Hi!
> Patch (against 2.6.3-rc1) removes unnecessary min/max macros and changes
> calls to use kernel.h macros instead.
> Feedback always welcome
> Michael
>
>
> ------------------------------------------------------------------------
>
> --- linux-2.6.2.org/drivers/net/acenic.c 2004-02-07 15:25:57.000000000 +0100
> +++ linux-2.6.2.new/drivers/net/acenic.c 2004-02-07 15:33:24.286033896 +0100
> @@ -335,10 +335,6 @@
> #define ACE_PROBE_ARG struct net_device *dev
> #endif
>
> -#ifndef min_t
> -#define min_t(type,a,b) (((a)<(b))?(a):(b))
> -#endif
Read the code you're patching :)
You're killing compat code the driver author added.
Jeff
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal
2004-02-07 15:37 [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal Michael Veeck
2004-02-07 16:30 ` Jeff Garzik
@ 2004-02-07 17:35 ` Michael Veeck
2004-02-16 18:33 ` Randy.Dunlap
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Michael Veeck @ 2004-02-07 17:35 UTC (permalink / raw)
To: kernel-janitors
Jeff Garzik schrieb:
> Michael Veeck wrote:
>
>> Hi!
>> Patch (against 2.6.3-rc1) removes unnecessary min/max macros and
>> changes calls to use kernel.h macros instead.
>> Feedback always welcome
>> Michael
>>
>>
>> ------------------------------------------------------------------------
>>
>> --- linux-2.6.2.org/drivers/net/acenic.c 2004-02-07
>> 15:25:57.000000000 +0100
>> +++ linux-2.6.2.new/drivers/net/acenic.c 2004-02-07
>> 15:33:24.286033896 +0100
>> @@ -335,10 +335,6 @@
>> #define ACE_PROBE_ARG struct net_device *dev
>> #endif
>>
>> -#ifndef min_t
>> -#define min_t(type,a,b) (((a)<(b))?(a):(b))
>> -#endif
>
>
>
> Read the code you're patching :)
>
> You're killing compat code the driver author added.
>
> Jeff
>
Ah, that didnt came into my mind. But since #ifndef min_t doesnt seem to
be in any of the "#if LINUX_VERSION_CODE >= " why not put it in the
appropiate one?
Do you know when the min_t was introduced in include/linux/kernel.h ?
Veeck
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal
2004-02-07 15:37 [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal Michael Veeck
2004-02-07 16:30 ` Jeff Garzik
2004-02-07 17:35 ` Michael Veeck
@ 2004-02-16 18:33 ` Randy.Dunlap
2004-02-17 12:53 ` Michael Veeck
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Randy.Dunlap @ 2004-02-16 18:33 UTC (permalink / raw)
To: kernel-janitors
On Sat, 07 Feb 2004 18:35:05 +0100 Michael Veeck <michael.veeck@gmx.net> wrote:
|
|
| Jeff Garzik schrieb:
| > Michael Veeck wrote:
| >
| >> Hi!
| >> Patch (against 2.6.3-rc1) removes unnecessary min/max macros and
| >> changes calls to use kernel.h macros instead.
| >> Feedback always welcome
| >> Michael
| >>
| >>
| >> ------------------------------------------------------------------------
| >>
| >> --- linux-2.6.2.org/drivers/net/acenic.c 2004-02-07
| >> 15:25:57.000000000 +0100
| >> +++ linux-2.6.2.new/drivers/net/acenic.c 2004-02-07
| >> 15:33:24.286033896 +0100
| >> @@ -335,10 +335,6 @@
| >> #define ACE_PROBE_ARG struct net_device *dev
| >> #endif
| >>
| >> -#ifndef min_t
| >> -#define min_t(type,a,b) (((a)<(b))?(a):(b))
| >> -#endif
| >
| >
| >
| > Read the code you're patching :)
| >
| > You're killing compat code the driver author added.
| >
| > Jeff
| >
|
| Ah, that didnt came into my mind. But since #ifndef min_t doesnt seem to
| be in any of the "#if LINUX_VERSION_CODE >= " why not put it in the
| appropiate one?
|
| Do you know when the min_t was introduced in include/linux/kernel.h ?
BK shows 5-FEB-2002 for min_t.
That would be early 2.5.x, like 2.5.4, estimating by looking at
http://www.kernel.org/pub/linux/kernel/v2.5/
--
~Randy
kernel-janitors project: http://janitor.kernelnewbies.org/
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal
2004-02-07 15:37 [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal Michael Veeck
` (2 preceding siblings ...)
2004-02-16 18:33 ` Randy.Dunlap
@ 2004-02-17 12:53 ` Michael Veeck
2004-04-06 23:45 ` Michael Veeck
2004-04-07 23:16 ` Randy.Dunlap
5 siblings, 0 replies; 7+ messages in thread
From: Michael Veeck @ 2004-02-17 12:53 UTC (permalink / raw)
To: kernel-janitors
Randy.Dunlap schrieb:
> On Sat, 07 Feb 2004 18:35:05 +0100 Michael Veeck <michael.veeck@gmx.net> wrote:
>
> |
> |
> | Jeff Garzik schrieb:
> | > Michael Veeck wrote:
> | >
> | >> Hi!
> | >> Patch (against 2.6.3-rc1) removes unnecessary min/max macros and
> | >> changes calls to use kernel.h macros instead.
> | >> Feedback always welcome
> | >> Michael
> | >>
> | >>
> | >> ------------------------------------------------------------------------
> | >>
> | >> --- linux-2.6.2.org/drivers/net/acenic.c 2004-02-07
> | >> 15:25:57.000000000 +0100
> | >> +++ linux-2.6.2.new/drivers/net/acenic.c 2004-02-07
> | >> 15:33:24.286033896 +0100
> | >> @@ -335,10 +335,6 @@
> | >> #define ACE_PROBE_ARG struct net_device *dev
> | >> #endif
> | >>
> | >> -#ifndef min_t
> | >> -#define min_t(type,a,b) (((a)<(b))?(a):(b))
> | >> -#endif
> | >
> | >
> | >
> | > Read the code you're patching :)
> | >
> | > You're killing compat code the driver author added.
> | >
> | > Jeff
> | >
> |
> | Ah, that didnt came into my mind. But since #ifndef min_t doesnt seem to
> | be in any of the "#if LINUX_VERSION_CODE >= " why not put it in the
> | appropiate one?
> |
> | Do you know when the min_t was introduced in include/linux/kernel.h ?
>
> BK shows 5-FEB-2002 for min_t.
> That would be early 2.5.x, like 2.5.4, estimating by looking at
> http://www.kernel.org/pub/linux/kernel/v2.5/
>
Digging through the changelogs on kernel.org I found out that
min_t/max_t macros were really introduced in 2.4.9 as "min/max" and then
changed to their min_t/max_t-name in 2.4.10.
I will incorproate that in my next patch! Thanks for the advice!
Veeck
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal
2004-02-07 15:37 [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal Michael Veeck
` (3 preceding siblings ...)
2004-02-17 12:53 ` Michael Veeck
@ 2004-04-06 23:45 ` Michael Veeck
2004-04-07 23:16 ` Randy.Dunlap
5 siblings, 0 replies; 7+ messages in thread
From: Michael Veeck @ 2004-04-06 23:45 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]
Michael Veeck wrote:
>
>
> Randy.Dunlap schrieb:
>
>> On Sat, 07 Feb 2004 18:35:05 +0100 Michael Veeck
>> <michael.veeck@gmx.net> wrote:
>>
>> | | | Jeff Garzik schrieb:
>> | > Michael Veeck wrote:
>> | > | >> Hi!
>> | >> Patch (against 2.6.3-rc1) removes unnecessary min/max macros and
>> | >> changes calls to use kernel.h macros instead.
>> | >> Feedback always welcome
>> | >> Michael
>> | >>
>> | >>
>> | >>
>> ------------------------------------------------------------------------
>> | >>
>> | >> --- linux-2.6.2.org/drivers/net/acenic.c 2004-02-07 | >>
>> 15:25:57.000000000 +0100
>> | >> +++ linux-2.6.2.new/drivers/net/acenic.c 2004-02-07 | >>
>> 15:33:24.286033896 +0100
>> | >> @@ -335,10 +335,6 @@
>> | >> #define ACE_PROBE_ARG struct net_device *dev
>> | >> #endif
>> | >> | >> -#ifndef min_t
>> | >> -#define min_t(type,a,b) (((a)<(b))?(a):(b))
>> | >> -#endif
>> | > | > | > | > Read the code you're patching :)
>> | > | > You're killing compat code the driver author added.
>> | > | > Jeff
>> | > | | Ah, that didnt came into my mind. But since #ifndef min_t
>> doesnt seem to | be in any of the "#if LINUX_VERSION_CODE >= " why not
>> put it in the | appropiate one?
>> | | Do you know when the min_t was introduced in include/linux/kernel.h ?
>>
>> BK shows 5-FEB-2002 for min_t.
>> That would be early 2.5.x, like 2.5.4, estimating by looking at
>> http://www.kernel.org/pub/linux/kernel/v2.5/
>>
>
> Digging through the changelogs on kernel.org I found out that
> min_t/max_t macros were really introduced in 2.4.9 as "min/max" and then
> changed to their min_t/max_t-name in 2.4.10.
>
> I will incorproate that in my next patch! Thanks for the advice!
>
> Veeck
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/kernel-janitors
>
>
Here is the new patch against kernel 2.6.5. Any comments?
Best regards
Michael Veeck
[-- Attachment #2: minmax_drivers_net_acenic.patch --]
[-- Type: text/plain, Size: 396 bytes --]
--- linux-2.6.5.org/drivers/net/acenic.c 2004-04-04 05:37:06.000000000 +0200
+++ linux-2.6.5.new/drivers/net/acenic.c 2004-04-06 23:55:33.141177224 +0200
@@ -335,9 +335,11 @@
#define ACE_PROBE_ARG struct net_device *dev
#endif
+#if (LINUX_VERSION_CODE < 0x02040a)
#ifndef min_t
#define min_t(type,a,b) (((a)<(b))?(a):(b))
#endif
+#endif
#ifndef ARCH_HAS_PREFETCHW
#ifndef prefetchw
[-- Attachment #3: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal
2004-02-07 15:37 [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal Michael Veeck
` (4 preceding siblings ...)
2004-04-06 23:45 ` Michael Veeck
@ 2004-04-07 23:16 ` Randy.Dunlap
5 siblings, 0 replies; 7+ messages in thread
From: Randy.Dunlap @ 2004-04-07 23:16 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 2548 bytes --]
On Wed, 07 Apr 2004 01:45:00 +0200 Michael Veeck wrote:
| Michael Veeck wrote:
| >
| > Randy.Dunlap schrieb:
| >
| >> On Sat, 07 Feb 2004 18:35:05 +0100 Michael Veeck
| >> <michael.veeck@gmx.net> wrote:
| >>
| >> | | | Jeff Garzik schrieb:
| >> | > Michael Veeck wrote:
| >> | > | >> Hi!
| >> | >> Patch (against 2.6.3-rc1) removes unnecessary min/max macros and
| >> | >> changes calls to use kernel.h macros instead.
| >> | >> Feedback always welcome
| >> | >> Michael
| >> | >>
| >> | >>
| >> | >>
| >> ------------------------------------------------------------------------
| >> | >>
| >> | >> --- linux-2.6.2.org/drivers/net/acenic.c 2004-02-07 | >>
| >> 15:25:57.000000000 +0100
| >> | >> +++ linux-2.6.2.new/drivers/net/acenic.c 2004-02-07 | >>
| >> 15:33:24.286033896 +0100
| >> | >> @@ -335,10 +335,6 @@
| >> | >> #define ACE_PROBE_ARG struct net_device *dev
| >> | >> #endif
| >> | >> | >> -#ifndef min_t
| >> | >> -#define min_t(type,a,b) (((a)<(b))?(a):(b))
| >> | >> -#endif
| >> | > | > | > | > Read the code you're patching :)
| >> | > | > You're killing compat code the driver author added.
| >> | > | > Jeff
| >> | > | | Ah, that didnt came into my mind. But since #ifndef min_t
| >> doesnt seem to | be in any of the "#if LINUX_VERSION_CODE >= " why not
| >> put it in the | appropiate one?
| >> | | Do you know when the min_t was introduced in include/linux/kernel.h ?
| >>
| >> BK shows 5-FEB-2002 for min_t.
| >> That would be early 2.5.x, like 2.5.4, estimating by looking at
| >> http://www.kernel.org/pub/linux/kernel/v2.5/
| >>
| >
| > Digging through the changelogs on kernel.org I found out that
| > min_t/max_t macros were really introduced in 2.4.9 as "min/max" and then
| > changed to their min_t/max_t-name in 2.4.10.
| >
| > I will incorproate that in my next patch! Thanks for the advice!
| >
|
| Here is the new patch against kernel 2.6.5. Any comments?
@@ -335,9 +335,11 @@
#define ACE_PROBE_ARG struct net_device *dev
#endif
+#if (LINUX_VERSION_CODE < 0x02040a)
#ifndef min_t
#define min_t(type,a,b) (((a)<(b))?(a):(b))
#endif
+#endif
#ifndef ARCH_HAS_PREFETCHW
#ifndef prefetchw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When is "min_t" not defined? IOW, it looks redundant to me.
This local #define of min_t() evaluates 1 arg 2 times. Isnt' that
a no-no? Wouldn't Jeff accept a patch for that?
--
~Randy
"We have met the enemy and he is us." -- Pogo (by Walt Kelly)
(Again. Sometimes I think ln -s /usr/src/linux/.config .signature)
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-04-07 23:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-07 15:37 [Kernel-janitors] [PATCH] drivers/net/acenic.c MIN/MAX removal Michael Veeck
2004-02-07 16:30 ` Jeff Garzik
2004-02-07 17:35 ` Michael Veeck
2004-02-16 18:33 ` Randy.Dunlap
2004-02-17 12:53 ` Michael Veeck
2004-04-06 23:45 ` Michael Veeck
2004-04-07 23:16 ` Randy.Dunlap
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.