lkml.org 
[lkml]   [2004]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6 patch] more MCA_LEGACY dependencies
On Fri, Jul 02, 2004 at 10:07:19AM -0300, Luiz Fernando N. Capitulino wrote:
>...
> | static int __init smctr_chk_mca(struct net_device *dev)
> | {
> | -#ifdef CONFIG_MCA
> | +#ifdef CONFIG_MCA_LEGACY
> | struct net_local *tp = netdev_priv(dev);
> | int current_slot;
> | __u8 r1, r2, r3, r4, r5;
> | @@ -626,7 +626,7 @@
> | return (0);
> | #else
> | return (-1);
> | -#endif /* CONFIG_MCA */
> | +#endif /* CONFIG_MCA_LEGACY */
> | }
>
> what about doing things like that for #ifdef/#endif inside
> functions? (not compiled):
>...
> +#ifdef CONFIG_MCA_LEGACY
> static int __init smctr_chk_mca(struct net_device *dev)
> {
> -#ifdef CONFIG_MCA
> struct net_local *tp = netdev_priv(dev);
> int current_slot;
> __u8 r1, r2, r3, r4, r5;
>...
> --- a/drivers/net/tokenring/smctr.h 2003-10-08 16:24:14.000000000 -0300
> +++ a~/drivers/net/tokenring/smctr.h 2004-07-02 09:56:56.000000000 -0300
> @@ -9,6 +9,11 @@
>
> #ifdef __KERNEL__
>
> +/* when !CONFIG_MCA_LEGACY */
> +#ifndef CONFIG_MCA_LEGACY
> +static inline smctr_chk_mca(struct net_device *dev) { return (-1); }
> +#endif
> +
>...

What's the advantage of your approach?
All it seems to do is to make the code less readable.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.042 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site