linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
@ 2005-11-02  7:14 Ashutosh Naik
  2005-11-02  9:31 ` Richard Knutsson
  0 siblings, 1 reply; 15+ messages in thread
From: Ashutosh Naik @ 2005-11-02  7:14 UTC (permalink / raw)
  To: rick, davej, acme, linux-net, akpm, linux-kernel, stable

This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
not enabled in the dgrc network driver.

Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

--
diff -Naurp linux-2.6.14/drivers/net/dgrs.c
linux-2.6.14-git1/drivers/net/dgrs.c---
linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
+0530
+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
10:30:03.000000000 +0530
@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
 static int __init dgrs_init_module (void)  {
        int     i;
-       int eisacount = 0, pcicount = 0;
-
+#ifdef CONFIG_EISA
+       int eisacount = 0;
+#endif
+#ifdef CONFIG_PCI
+       int pcicount = 0;
+#endif
        /*
         *      Command line variable overrides
         *              debug=NNN

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-02  7:14 [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled Ashutosh Naik
@ 2005-11-02  9:31 ` Richard Knutsson
  2005-11-02 13:16   ` Ashutosh Naik
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Knutsson @ 2005-11-02  9:31 UTC (permalink / raw)
  To: Ashutosh Naik; +Cc: rick, davej, acme, linux-net, akpm, linux-kernel, stable

Ashutosh Naik wrote:

>This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
>not enabled in the dgrc network driver.
>
>Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
>
>--
>diff -Naurp linux-2.6.14/drivers/net/dgrs.c
>linux-2.6.14-git1/drivers/net/dgrs.c---
>linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
>+0530
>+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
>10:30:03.000000000 +0530
>@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
> static int __init dgrs_init_module (void)  {
>        int     i;
>-       int eisacount = 0, pcicount = 0;
>-
>+#ifdef CONFIG_EISA
>+       int eisacount = 0;
>+#endif
>+#ifdef CONFIG_PCI
>+       int pcicount = 0;
>+#endif
>        /*
>         *      Command line variable overrides
>         *              debug=NNN
>-
>  
>
Since eisacount and pcicount is doing the same task (and they are only 
used in sequence) and to preventing more #ifdef in the source-code, why 
not use the same variable? It will give an warning if both of them is 
not defined, but is that an issue? If so,
#if !defined CONFIG_EISA && !defined CONFIG_PCI
could encapsulate the variable to prevent that.

Posted 26'th of October and now also checked against 2.6.14-git1.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>

---

diff -uNr a/drivers/net/dgrs.c b/drivers/net/dgrs.c
--- a/drivers/net/dgrs.c	2005-08-29 01:41:01.000000000 +0200
+++ b/drivers/net/dgrs.c	2005-10-26 15:53:43.000000000 +0200
@@ -1549,7 +1549,7 @@
 static int __init dgrs_init_module (void)
 {
 	int	i;
-	int eisacount = 0, pcicount = 0;
+	int	count;
 
 	/*
 	 *	Command line variable overrides
@@ -1591,14 +1591,14 @@
 	 *	Find and configure all the cards
 	 */
 #ifdef CONFIG_EISA
-	eisacount = eisa_driver_register(&dgrs_eisa_driver);
-	if (eisacount < 0)
-		return eisacount;
+	count = eisa_driver_register(&dgrs_eisa_driver);
+	if (count < 0)
+		return count;
 #endif
 #ifdef CONFIG_PCI
-	pcicount = pci_register_driver(&dgrs_pci_driver);
-	if (pcicount)
-		return pcicount;
+	count = pci_register_driver(&dgrs_pci_driver);
+	if (count)
+		return count;
 #endif
 	return 0;
 }



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-02  9:31 ` Richard Knutsson
@ 2005-11-02 13:16   ` Ashutosh Naik
  2005-11-02 20:55     ` Richard Knutsson
  0 siblings, 1 reply; 15+ messages in thread
From: Ashutosh Naik @ 2005-11-02 13:16 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: Ashutosh Naik, rick, davej, acme, linux-net, akpm, linux-kernel, stable

On 11/2/05, Richard Knutsson <ricknu-0@student.ltu.se> wrote:
> Ashutosh Naik wrote:
>
> >This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
> >not enabled in the dgrc network driver.
> >
> >Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
> >
> >--
> >diff -Naurp linux-2.6.14/drivers/net/dgrs.c
> >linux-2.6.14-git1/drivers/net/dgrs.c---
> >linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
> >+0530
> >+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
> >10:30:03.000000000 +0530
> >@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
> > static int __init dgrs_init_module (void)  {
> >        int     i;
> >-       int eisacount = 0, pcicount = 0;
> >-
> >+#ifdef CONFIG_EISA
> >+       int eisacount = 0;
> >+#endif
> >+#ifdef CONFIG_PCI
> >+       int pcicount = 0;
> >+#endif
> >        /*
> >         *      Command line variable overrides
> >         *              debug=NNN
> >-
> >
> >
> Since eisacount and pcicount is doing the same task (and they are only
> used in sequence) and to preventing more #ifdef in the source-code, why
> not use the same variable? It will give an warning if both of them is
> not defined, but is that an issue? If so,
> #if !defined CONFIG_EISA && !defined CONFIG_PCI
> could encapsulate the variable to prevent that.
>
> Posted 26'th of October and now also checked against 2.6.14-git1.
>
> Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
>
> ---
>
> diff -uNr a/drivers/net/dgrs.c b/drivers/net/dgrs.c
> --- a/drivers/net/dgrs.c        2005-08-29 01:41:01.000000000 +0200
> +++ b/drivers/net/dgrs.c        2005-10-26 15:53:43.000000000 +0200
> @@ -1549,7 +1549,7 @@
>  static int __init dgrs_init_module (void)
>  {
>         int     i;
> -       int eisacount = 0, pcicount = 0;
> +       int     count;
>
>         /*
>          *      Command line variable overrides
> @@ -1591,14 +1591,14 @@
>          *      Find and configure all the cards
>          */
>  #ifdef CONFIG_EISA
> -       eisacount = eisa_driver_register(&dgrs_eisa_driver);
> -       if (eisacount < 0)
> -               return eisacount;
> +       count = eisa_driver_register(&dgrs_eisa_driver);
> +       if (count < 0)
> +               return count;
>  #endif
>  #ifdef CONFIG_PCI
> -       pcicount = pci_register_driver(&dgrs_pci_driver);
> -       if (pcicount)
> -               return pcicount;
> +       count = pci_register_driver(&dgrs_pci_driver);
> +       if (count)
> +               return count;
>  #endif
>         return 0;
>  }

Well, both of them do the same stuff, but one of these patches needs
to be committed.

Cheers
Ashutosh

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-02 13:16   ` Ashutosh Naik
@ 2005-11-02 20:55     ` Richard Knutsson
  2005-11-03  5:39       ` Ashutosh Naik
  2005-11-05  2:25       ` [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and " Andrew Morton
  0 siblings, 2 replies; 15+ messages in thread
From: Richard Knutsson @ 2005-11-02 20:55 UTC (permalink / raw)
  To: Ashutosh Naik; +Cc: netdev, davej, acme, linux-net, akpm, linux-kernel, stable

>
>
>>>This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
>>>not enabled in the dgrc network driver.
>>>
>>>Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
>>>
>>>--
>>>diff -Naurp linux-2.6.14/drivers/net/dgrs.c
>>>linux-2.6.14-git1/drivers/net/dgrs.c---
>>>linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
>>>+0530
>>>+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
>>>10:30:03.000000000 +0530
>>>@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
>>>static int __init dgrs_init_module (void)  {
>>>       int     i;
>>>-       int eisacount = 0, pcicount = 0;
>>>-
>>>+#ifdef CONFIG_EISA
>>>+       int eisacount = 0;
>>>+#endif
>>>+#ifdef CONFIG_PCI
>>>+       int pcicount = 0;
>>>+#endif
>>>       /*
>>>        *      Command line variable overrides
>>>        *              debug=NNN
>>>-
>>>      
>>>

>>Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
>>
>>---
>>
>>diff -uNr a/drivers/net/dgrs.c b/drivers/net/dgrs.c
>>--- a/drivers/net/dgrs.c        2005-08-29 01:41:01.000000000 +0200
>>+++ b/drivers/net/dgrs.c        2005-10-26 15:53:43.000000000 +0200
>>@@ -1549,7 +1549,7 @@
>> static int __init dgrs_init_module (void)
>> {
>>        int     i;
>>-       int eisacount = 0, pcicount = 0;
>>+       int     count;
>>
>>        /*
>>         *      Command line variable overrides
>>@@ -1591,14 +1591,14 @@
>>         *      Find and configure all the cards
>>         */
>> #ifdef CONFIG_EISA
>>-       eisacount = eisa_driver_register(&dgrs_eisa_driver);
>>-       if (eisacount < 0)
>>-               return eisacount;
>>+       count = eisa_driver_register(&dgrs_eisa_driver);
>>+       if (count < 0)
>>+               return count;
>> #endif
>> #ifdef CONFIG_PCI
>>-       pcicount = pci_register_driver(&dgrs_pci_driver);
>>-       if (pcicount)
>>-               return pcicount;
>>+       count = pci_register_driver(&dgrs_pci_driver);
>>+       if (count)
>>+               return count;
>> #endif
>>        return 0;
>> }
>>    
>>
>
>Well, both of them do the same stuff, but one of these patches needs
>to be committed.
>
>Cheers
>Ashutosh
>  
>
Can both CONFIG_PCI and CONFIG_EISA be undefined at the same time? If 
so, I think you patch is better.
But on line 1015 in the dgrs.c-file (function dgrs_download()) there is 
an if-statement:
    if (priv0->plxreg)
    {    /* PCI bus */
        ...
    }
    else
    {    /* EISA bus */
        ...
from where I got the idea it needs either pci or eisa (or both). If this 
is true, I vote for my patch.

Live long and prosper
/Richard

PS
Rick's mail-address in the file seems invalid. Changed it to 
netdev@vger.kernel.org, since that is the address in the MAINTAINERS-file.
DS


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-02 20:55     ` Richard Knutsson
@ 2005-11-03  5:39       ` Ashutosh Naik
  2005-11-03 23:13         ` [PATCH] /drivers/net/dgrs.c - Fixes Warnings when CONFIG_EISA or " Richard Knutsson
  2005-11-05  2:25       ` [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and " Andrew Morton
  1 sibling, 1 reply; 15+ messages in thread
From: Ashutosh Naik @ 2005-11-03  5:39 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: netdev, davej, acme, linux-net, akpm, linux-kernel, stable

On 11/3/05, Richard Knutsson <ricknu-0@student.ltu.se> wrote:
> >
> >
> >>>This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
> >>>not enabled in the dgrc network driver.
> >>>
> >>>Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
> >>>
> >>>--
> >>>diff -Naurp linux-2.6.14/drivers/net/dgrs.c
> >>>linux-2.6.14-git1/drivers/net/dgrs.c---
> >>>linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
> >>>+0530
> >>>+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
> >>>10:30:03.000000000 +0530
> >>>@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
> >>>static int __init dgrs_init_module (void)  {
> >>>       int     i;
> >>>-       int eisacount = 0, pcicount = 0;
> >>>-
> >>>+#ifdef CONFIG_EISA
> >>>+       int eisacount = 0;
> >>>+#endif
> >>>+#ifdef CONFIG_PCI
> >>>+       int pcicount = 0;
> >>>+#endif
> >>>       /*
> >>>        *      Command line variable overrides
> >>>        *              debug=NNN
> >>>-
> >>>
> >>>
>
> >>Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
> >>
> >>---
> >>
> >>diff -uNr a/drivers/net/dgrs.c b/drivers/net/dgrs.c
> >>--- a/drivers/net/dgrs.c        2005-08-29 01:41:01.000000000 +0200
> >>+++ b/drivers/net/dgrs.c        2005-10-26 15:53:43.000000000 +0200
> >>@@ -1549,7 +1549,7 @@
> >> static int __init dgrs_init_module (void)
> >> {
> >>        int     i;
> >>-       int eisacount = 0, pcicount = 0;
> >>+       int     count;
> >>
> >>        /*
> >>         *      Command line variable overrides
> >>@@ -1591,14 +1591,14 @@
> >>         *      Find and configure all the cards
> >>         */
> >> #ifdef CONFIG_EISA
> >>-       eisacount = eisa_driver_register(&dgrs_eisa_driver);
> >>-       if (eisacount < 0)
> >>-               return eisacount;
> >>+       count = eisa_driver_register(&dgrs_eisa_driver);
> >>+       if (count < 0)
> >>+               return count;
> >> #endif
> >> #ifdef CONFIG_PCI
> >>-       pcicount = pci_register_driver(&dgrs_pci_driver);
> >>-       if (pcicount)
> >>-               return pcicount;
> >>+       count = pci_register_driver(&dgrs_pci_driver);
> >>+       if (count)
> >>+               return count;
> >> #endif
> >>        return 0;
> >> }
> >>
> >>
> >
> >Well, both of them do the same stuff, but one of these patches needs
> >to be committed.
> >
> >Cheers
> >Ashutosh
> >
> >
> Can both CONFIG_PCI and CONFIG_EISA be undefined at the same time? If
> so, I think you patch is better.
> But on line 1015 in the dgrs.c-file (function dgrs_download()) there is
> an if-statement:
>     if (priv0->plxreg)
>     {    /* PCI bus */
>         ...
>     }
>     else
>     {    /* EISA bus */
>         ...
> from where I got the idea it needs either pci or eisa (or both). If this
> is true, I vote for my patch.

Both CONFIG_PCI and CONFIG_EISA cant be undefined at the same time,
because the device has to be on either of the 2 busses. I think your
patch is better in that case.

Cheers
Ashutosh

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] /drivers/net/dgrs.c - Fixes Warnings when CONFIG_EISA or CONFIG_PCI are not enabled
  2005-11-03  5:39       ` Ashutosh Naik
@ 2005-11-03 23:13         ` Richard Knutsson
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Knutsson @ 2005-11-03 23:13 UTC (permalink / raw)
  To: Ashutosh Naik
  Cc: netdev, davej, acme, linux-net, akpm, linux-kernel, stable, trivial


>>>>>This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
>>>>>not enabled in the dgrc network driver.
>>>>>
>>>>>Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>	
>>>>>
>>>>>--
>>>>>diff -Naurp linux-2.6.14/drivers/net/dgrs.c
>>>>>linux-2.6.14-git1/drivers/net/dgrs.c---
>>>>>linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
>>>>>+0530
>>>>>+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
>>>>>10:30:03.000000000 +0530
>>>>>@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
>>>>>static int __init dgrs_init_module (void)  {
>>>>>      int     i;
>>>>>-       int eisacount = 0, pcicount = 0;
>>>>>-
>>>>>+#ifdef CONFIG_EISA
>>>>>+       int eisacount = 0;
>>>>>+#endif
>>>>>+#ifdef CONFIG_PCI
>>>>>+       int pcicount = 0;
>>>>>+#endif
>>>>>      /*
>>>>>       *      Command line variable overrides
>>>>>       *              debug=NNN
>>>>>          
>>>>>
>
>Both CONFIG_PCI and CONFIG_EISA cant be undefined at the same time,
>because the device has to be on either of the 2 busses. I think your
>patch is better in that case.
>
>Cheers
>Ashutosh
>  
>
OK, then I send in the patch again. Thanks for your help/opinion.

Till the next time...
/Richard

<--  snip  -->

This patch fixes compiler warnings when CONFIG_ISA or CONFIG_PCI are not enabled in the dgrc network driver.

Cleanly patched to 2.6.14-git6.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>

---

diff -Nurp a/drivers/net/dgrs.c b/drivers/net/dgrs.c
--- a/drivers/net/dgrs.c	2005-10-28 02:02:08.000000000 +0200
+++ b/drivers/net/dgrs.c	2005-11-02 10:19:43.000000000 +0100
@@ -1549,7 +1549,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
 static int __init dgrs_init_module (void)
 {
 	int	i;
-	int eisacount = 0, pcicount = 0;
+	int	count;
 
 	/*
 	 *	Command line variable overrides
@@ -1591,14 +1591,14 @@ static int __init dgrs_init_module (void
 	 *	Find and configure all the cards
 	 */
 #ifdef CONFIG_EISA
-	eisacount = eisa_driver_register(&dgrs_eisa_driver);
-	if (eisacount < 0)
-		return eisacount;
+	count = eisa_driver_register(&dgrs_eisa_driver);
+	if (count < 0)
+		return count;
 #endif
 #ifdef CONFIG_PCI
-	pcicount = pci_register_driver(&dgrs_pci_driver);
-	if (pcicount)
-		return pcicount;
+	count = pci_register_driver(&dgrs_pci_driver);
+	if (count)
+		return count;
 #endif
 	return 0;
 }



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-02 20:55     ` Richard Knutsson
  2005-11-03  5:39       ` Ashutosh Naik
@ 2005-11-05  2:25       ` Andrew Morton
  2005-11-05  2:30         ` Andrew Morton
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Morton @ 2005-11-05  2:25 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: ashutosh.lkml, netdev, davej, acme, linux-net, linux-kernel, stable

Richard Knutsson <ricknu-0@student.ltu.se> wrote:
>
> >
> >
> >>>This patch fixes compiler warnings when CONFIG_ISA and CONFIG_PCI are
> >>>not enabled in the dgrc network driver.
> >>>
> >>>Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
> >>>
> >>>--
> >>>diff -Naurp linux-2.6.14/drivers/net/dgrs.c
> >>>linux-2.6.14-git1/drivers/net/dgrs.c---
> >>>linux-2.6.14/drivers/net/dgrs.c     2005-10-28 05:32:08.000000000
> >>>+0530
> >>>+++ linux-2.6.14-git1/drivers/net/dgrs.c        2005-11-01
> >>>10:30:03.000000000 +0530
> >>>@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
> >>>static int __init dgrs_init_module (void)  {
> >>>       int     i;
> >>>-       int eisacount = 0, pcicount = 0;
> >>>-
> >>>+#ifdef CONFIG_EISA
> >>>+       int eisacount = 0;
> >>>+#endif
> >>>+#ifdef CONFIG_PCI
> >>>+       int pcicount = 0;
> >>>+#endif
> >>>       /*
> >>>        *      Command line variable overrides
> >>>        *              debug=NNN
> >>>-
> >>>      
> >>>
> 
> >>Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
> >>
> >>---
> >>
> >>diff -uNr a/drivers/net/dgrs.c b/drivers/net/dgrs.c
> >>--- a/drivers/net/dgrs.c        2005-08-29 01:41:01.000000000 +0200
> >>+++ b/drivers/net/dgrs.c        2005-10-26 15:53:43.000000000 +0200
> >>@@ -1549,7 +1549,7 @@
> >> static int __init dgrs_init_module (void)
> >> {
> >>        int     i;
> >>-       int eisacount = 0, pcicount = 0;
> >>+       int     count;
> >>
> >>        /*
> >>         *      Command line variable overrides
> >>@@ -1591,14 +1591,14 @@
> >>         *      Find and configure all the cards
> >>         */
> >> #ifdef CONFIG_EISA
> >>-       eisacount = eisa_driver_register(&dgrs_eisa_driver);
> >>-       if (eisacount < 0)
> >>-               return eisacount;
> >>+       count = eisa_driver_register(&dgrs_eisa_driver);
> >>+       if (count < 0)
> >>+               return count;
> >> #endif
> >> #ifdef CONFIG_PCI
> >>-       pcicount = pci_register_driver(&dgrs_pci_driver);
> >>-       if (pcicount)
> >>-               return pcicount;
> >>+       count = pci_register_driver(&dgrs_pci_driver);
> >>+       if (count)
> >>+               return count;
> >> #endif
> >>        return 0;
> >> }
> >>    
> >>
> >
> >Well, both of them do the same stuff, but one of these patches needs
> >to be committed.
> >
> >Cheers
> >Ashutosh
> >  
> >
> Can both CONFIG_PCI and CONFIG_EISA be undefined at the same time? If 
> so

Not for this driver.   From drivers/net/dgrs.c:

config DGRS
	tristate "Digi Intl. RightSwitch SE-X support"
	depends on NET_PCI && (PCI || EISA)

> I think you patch is better.

Let's go with Ashutosh's patch then, thanks.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05  2:25       ` [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and " Andrew Morton
@ 2005-11-05  2:30         ` Andrew Morton
  2005-11-05  4:51           ` Ashutosh Naik
  2005-11-05  8:36           ` Richard Knutsson
  0 siblings, 2 replies; 15+ messages in thread
From: Andrew Morton @ 2005-11-05  2:30 UTC (permalink / raw)
  To: ricknu-0, ashutosh.lkml, netdev, davej, acme, linux-net,
	linux-kernel, stable

Andrew Morton <akpm@osdl.org> wrote:
>
> Let's go with Ashutosh's patch then, thanks.

(It was wordwrapped.  Please fix your email client)

In fact we can de-ifdef things a bit.

diff -puN drivers/net/dgrs.c~dgrs-fixes-warnings-when-config_isa-and-config_pci-are-not-enabled drivers/net/dgrs.c
--- devel/drivers/net/dgrs.c~dgrs-fixes-warnings-when-config_isa-and-config_pci-are-not-enabled	2005-11-04 18:26:59.000000000 -0800
+++ devel-akpm/drivers/net/dgrs.c	2005-11-04 18:29:24.000000000 -0800
@@ -1549,7 +1549,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
 static int __init dgrs_init_module (void)
 {
 	int	i;
-	int eisacount = 0, pcicount = 0;
+	int	cardcount = 0;
 
 	/*
 	 *	Command line variable overrides
@@ -1591,15 +1591,13 @@ static int __init dgrs_init_module (void
 	 *	Find and configure all the cards
 	 */
 #ifdef CONFIG_EISA
-	eisacount = eisa_driver_register(&dgrs_eisa_driver);
-	if (eisacount < 0)
-		return eisacount;
-#endif
-#ifdef CONFIG_PCI
-	pcicount = pci_register_driver(&dgrs_pci_driver);
-	if (pcicount)
-		return pcicount;
+	cardcount = eisa_driver_register(&dgrs_eisa_driver);
+	if (cardcount < 0)
+		return cardcount;
 #endif
+	cardcount = pci_register_driver(&dgrs_pci_driver);
+	if (cardcount)
+		return cardcount;
 	return 0;
 }
 
_


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05  2:30         ` Andrew Morton
@ 2005-11-05  4:51           ` Ashutosh Naik
  2005-11-05  8:36           ` Richard Knutsson
  1 sibling, 0 replies; 15+ messages in thread
From: Ashutosh Naik @ 2005-11-05  4:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ricknu-0, netdev, davej, acme, linux-net, linux-kernel, stable

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

Hi Andrew,

On 11/5/05, Andrew Morton <akpm@osdl.org> wrote:
> Andrew Morton <akpm@osdl.org> wrote:
> >
> > Let's go with Ashutosh's patch then, thanks.
>
> (It was wordwrapped.  Please fix your email client)

I am attaching the patch.

Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

> In fact we can de-ifdef things a bit.
>
> diff -puN drivers/net/dgrs.c~dgrs-fixes-warnings-when-config_isa-and-config_pci-are-not-enabled drivers/net/dgrs.c
> --- devel/drivers/net/dgrs.c~dgrs-fixes-warnings-when-config_isa-and-config_pci-are-not-enabled 2005-11-04 18:26:59.000000000 -0800
> +++ devel-akpm/drivers/net/dgrs.c       2005-11-04 18:29:24.000000000 -0800
> @@ -1549,7 +1549,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
>  static int __init dgrs_init_module (void)
>  {
>         int     i;
> -       int eisacount = 0, pcicount = 0;
> +       int     cardcount = 0;
>
>         /*
>          *      Command line variable overrides
> @@ -1591,15 +1591,13 @@ static int __init dgrs_init_module (void
>          *      Find and configure all the cards
>          */
>  #ifdef CONFIG_EISA
> -       eisacount = eisa_driver_register(&dgrs_eisa_driver);
> -       if (eisacount < 0)
> -               return eisacount;
> -#endif
> -#ifdef CONFIG_PCI
> -       pcicount = pci_register_driver(&dgrs_pci_driver);
> -       if (pcicount)
> -               return pcicount;
> +       cardcount = eisa_driver_register(&dgrs_eisa_driver);
> +       if (cardcount < 0)
> +               return cardcount;
>  #endif
> +       cardcount = pci_register_driver(&dgrs_pci_driver);
> +       if (cardcount)
> +               return cardcount;
>         return 0;
>  }
>

Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

Acked. The above patch does the trick too. Any one can be committed.

Cheers
Ashutosh

[-- Attachment #2: dgrs-patch.txt --]
[-- Type: text/plain, Size: 540 bytes --]

diff -Naurp linux-2.6.14/drivers/net/dgrs.c linux-2.6.14-git1/drivers/net/dgrs.c
--- linux-2.6.14/drivers/net/dgrs.c	2005-10-28 05:32:08.000000000 +0530
+++ linux-2.6.14-git1/drivers/net/dgrs.c	2005-11-01 10:30:03.000000000 +0530
@@ -1549,8 +1549,12 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
 static int __init dgrs_init_module (void)
 {
 	int	i;
-	int eisacount = 0, pcicount = 0;
-
+#ifdef CONFIG_EISA
+	int eisacount = 0;
+#endif
+#ifdef CONFIG_PCI
+	int pcicount = 0;
+#endif
 	/*
 	 *	Command line variable overrides
 	 *		debug=NNN

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05  2:30         ` Andrew Morton
  2005-11-05  4:51           ` Ashutosh Naik
@ 2005-11-05  8:36           ` Richard Knutsson
  2005-11-05  8:46             ` Andrew Morton
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Knutsson @ 2005-11-05  8:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ashutosh.lkml, netdev, davej, acme, linux-net, linux-kernel, stable

Andrew Morton wrote:

>In fact we can de-ifdef things a bit.
>
>diff -puN drivers/net/dgrs.c~dgrs-fixes-warnings-when-config_isa-and-config_pci-are-not-enabled drivers/net/dgrs.c
>--- devel/drivers/net/dgrs.c~dgrs-fixes-warnings-when-config_isa-and-config_pci-are-not-enabled	2005-11-04 18:26:59.000000000 -0800
>+++ devel-akpm/drivers/net/dgrs.c	2005-11-04 18:29:24.000000000 -0800
>@@ -1549,7 +1549,7 @@ MODULE_PARM_DESC(nicmode, "Digi RightSwi
> static int __init dgrs_init_module (void)
> {
> 	int	i;
>-	int eisacount = 0, pcicount = 0;
>+	int	cardcount = 0;
> 
> 	/*
> 	 *	Command line variable overrides
>@@ -1591,15 +1591,13 @@ static int __init dgrs_init_module (void
> 	 *	Find and configure all the cards
> 	 */
> #ifdef CONFIG_EISA
>-	eisacount = eisa_driver_register(&dgrs_eisa_driver);
>-	if (eisacount < 0)
>-		return eisacount;
>-#endif
>-#ifdef CONFIG_PCI
>-	pcicount = pci_register_driver(&dgrs_pci_driver);
>-	if (pcicount)
>-		return pcicount;
>+	cardcount = eisa_driver_register(&dgrs_eisa_driver);
>+	if (cardcount < 0)
>+		return cardcount;
> #endif
>+	cardcount = pci_register_driver(&dgrs_pci_driver);
>+	if (cardcount)
>+		return cardcount;
> 	return 0;
> }
>  
>
I do not know what to think about this one:
* reduce one #ifdef: good
* check for something clearly stated not to: not so good

But as Ashutosh Naik said: Any one can be committed.

/Richard


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05  8:36           ` Richard Knutsson
@ 2005-11-05  8:46             ` Andrew Morton
  2005-11-05 11:54               ` Richard Knutsson
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Morton @ 2005-11-05  8:46 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: ashutosh.lkml, netdev, davej, acme, linux-net, linux-kernel, stable

Richard Knutsson <ricknu-0@student.ltu.se> wrote:
>
> > 	 */
>  > #ifdef CONFIG_EISA
>  >-	eisacount = eisa_driver_register(&dgrs_eisa_driver);
>  >-	if (eisacount < 0)
>  >-		return eisacount;
>  >-#endif
>  >-#ifdef CONFIG_PCI
>  >-	pcicount = pci_register_driver(&dgrs_pci_driver);
>  >-	if (pcicount)
>  >-		return pcicount;
>  >+	cardcount = eisa_driver_register(&dgrs_eisa_driver);
>  >+	if (cardcount < 0)
>  >+		return cardcount;
>  > #endif
>  >+	cardcount = pci_register_driver(&dgrs_pci_driver);
>  >+	if (cardcount)
>  >+		return cardcount;
>  > 	return 0;
>  > }
>  >  
>  >
>  I do not know what to think about this one:
>  * reduce one #ifdef: good
>  * check for something clearly stated not to: not so good

Well a nicer fix would be to provide a stub implementation of
eisa_driver_register() if !CONFIG_EISA, just like pci_register_driver(). 
Then all the ifdefs go away and the compiler removes all the code for us,
after checking that we typed it correctly.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05  8:46             ` Andrew Morton
@ 2005-11-05 11:54               ` Richard Knutsson
  2005-11-05 15:29                 ` Richard Knutsson
  2005-11-05 17:46                 ` Andrew Morton
  0 siblings, 2 replies; 15+ messages in thread
From: Richard Knutsson @ 2005-11-05 11:54 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ashutosh.lkml, netdev, davej, acme, linux-net, linux-kernel, stable

Andrew Morton wrote:

>Richard Knutsson <ricknu-0@student.ltu.se> wrote:
>  
>
>>>	 */
>>>      
>>>
>> > #ifdef CONFIG_EISA
>> >-	eisacount = eisa_driver_register(&dgrs_eisa_driver);
>> >-	if (eisacount < 0)
>> >-		return eisacount;
>> >-#endif
>> >-#ifdef CONFIG_PCI
>> >-	pcicount = pci_register_driver(&dgrs_pci_driver);
>> >-	if (pcicount)
>> >-		return pcicount;
>> >+	cardcount = eisa_driver_register(&dgrs_eisa_driver);
>> >+	if (cardcount < 0)
>> >+		return cardcount;
>> > #endif
>> >+	cardcount = pci_register_driver(&dgrs_pci_driver);
>> >+	if (cardcount)
>> >+		return cardcount;
>> > 	return 0;
>> > }
>> >  
>> >
>> I do not know what to think about this one:
>> * reduce one #ifdef: good
>> * check for something clearly stated not to: not so good
>>    
>>
>
>Well a nicer fix would be to provide a stub implementation of
>eisa_driver_register() if !CONFIG_EISA, just like pci_register_driver(). 
>Then all the ifdefs go away and the compiler removes all the code for us,
>after checking that we typed it correctly.
>  
>
Oh, sorry. Missed the stub implementation of the pci-driver. I "ack" 
your patch.

BTW, can anyone ack or is that up to the maintainers?
BTW #2, why not remove #ifdef CONFIG_PCI on dgrs_cleanup_module() at the 
same time? Or maybe that should be in a "remove config_pci"-patch...

/Richard


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05 11:54               ` Richard Knutsson
@ 2005-11-05 15:29                 ` Richard Knutsson
  2005-11-05 17:45                   ` Andrew Morton
  2005-11-05 17:46                 ` Andrew Morton
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Knutsson @ 2005-11-05 15:29 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: Andrew Morton, ashutosh.lkml, netdev, davej, acme, linux-net,
	linux-kernel, stable

Richard Knutsson wrote:

> Andrew Morton wrote:
>
>> Richard Knutsson <ricknu-0@student.ltu.se> wrote:
>>  
>>
>>>>      */
>>>>     
>>>
>>> > #ifdef CONFIG_EISA
>>> >-    eisacount = eisa_driver_register(&dgrs_eisa_driver);
>>> >-    if (eisacount < 0)
>>> >-        return eisacount;
>>> >-#endif
>>> >-#ifdef CONFIG_PCI
>>> >-    pcicount = pci_register_driver(&dgrs_pci_driver);
>>> >-    if (pcicount)
>>> >-        return pcicount;
>>> >+    cardcount = eisa_driver_register(&dgrs_eisa_driver);
>>> >+    if (cardcount < 0)
>>> >+        return cardcount;
>>> > #endif
>>> >+    cardcount = pci_register_driver(&dgrs_pci_driver);
>>> >+    if (cardcount)
>>> >+        return cardcount;
>>> >     return 0;
>>> > }
>>> >  >
>>> I do not know what to think about this one:
>>> * reduce one #ifdef: good
>>> * check for something clearly stated not to: not so good
>>>   
>>
>>
>> Well a nicer fix would be to provide a stub implementation of
>> eisa_driver_register() if !CONFIG_EISA, just like 
>> pci_register_driver(). Then all the ifdefs go away and the compiler 
>> removes all the code for us,
>> after checking that we typed it correctly.
>>  
>>
> Oh, sorry. Missed the stub implementation of the pci-driver. I "ack" 
> your patch.
>
> BTW, can anyone ack or is that up to the maintainers?
> BTW #2, why not remove #ifdef CONFIG_PCI on dgrs_cleanup_module() at 
> the same time? Or maybe that should be in a "remove config_pci"-patch...
>
> /Richard

Just realized; what happens if CONFIG_EISA && !CONFIG_PCI and 
eisa_driver_register() returns value > 0, then the if-statement for the 
pci-driver is going to return the value, instead of 0.

/Richard


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05 15:29                 ` Richard Knutsson
@ 2005-11-05 17:45                   ` Andrew Morton
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Morton @ 2005-11-05 17:45 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: ricknu-0, ashutosh.lkml, netdev, davej, acme, linux-net,
	linux-kernel, stable

Richard Knutsson <ricknu-0@student.ltu.se> wrote:
>
> Richard Knutsson wrote:
> 
> > Andrew Morton wrote:
> >
> >> Richard Knutsson <ricknu-0@student.ltu.se> wrote:
> >>  
> >>
> >>>>      */
> >>>>     
> >>>
> >>> > #ifdef CONFIG_EISA
> >>> >-    eisacount = eisa_driver_register(&dgrs_eisa_driver);
> >>> >-    if (eisacount < 0)
> >>> >-        return eisacount;
> >>> >-#endif
> >>> >-#ifdef CONFIG_PCI
> >>> >-    pcicount = pci_register_driver(&dgrs_pci_driver);
> >>> >-    if (pcicount)
> >>> >-        return pcicount;
> >>> >+    cardcount = eisa_driver_register(&dgrs_eisa_driver);
> >>> >+    if (cardcount < 0)
> >>> >+        return cardcount;
> >>> > #endif
> >>> >+    cardcount = pci_register_driver(&dgrs_pci_driver);
> >>> >+    if (cardcount)
> >>> >+        return cardcount;
> >>> >     return 0;
> >>> > }
> >>> >  >
> >>> I do not know what to think about this one:
> >>> * reduce one #ifdef: good
> >>> * check for something clearly stated not to: not so good
> >>>   
> >>
> >>
> >> Well a nicer fix would be to provide a stub implementation of
> >> eisa_driver_register() if !CONFIG_EISA, just like 
> >> pci_register_driver(). Then all the ifdefs go away and the compiler 
> >> removes all the code for us,
> >> after checking that we typed it correctly.
> >>  
> >>
> > Oh, sorry. Missed the stub implementation of the pci-driver. I "ack" 
> > your patch.
> >
> > BTW, can anyone ack or is that up to the maintainers?
> > BTW #2, why not remove #ifdef CONFIG_PCI on dgrs_cleanup_module() at 
> > the same time? Or maybe that should be in a "remove config_pci"-patch...
> >
> > /Richard
> 
> Just realized; what happens if CONFIG_EISA && !CONFIG_PCI and 
> eisa_driver_register() returns value > 0, then the if-statement for the 
> pci-driver is going to return the value, instead of 0.

if !CONFIG_PCI, pci_register_driver() will return zero.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled
  2005-11-05 11:54               ` Richard Knutsson
  2005-11-05 15:29                 ` Richard Knutsson
@ 2005-11-05 17:46                 ` Andrew Morton
  1 sibling, 0 replies; 15+ messages in thread
From: Andrew Morton @ 2005-11-05 17:46 UTC (permalink / raw)
  To: Richard Knutsson
  Cc: ashutosh.lkml, netdev, davej, acme, linux-net, linux-kernel, stable

Richard Knutsson <ricknu-0@student.ltu.se> wrote:
>
>  BTW, can anyone ack or is that up to the maintainers?

It's useful info - it shows that someone else took the time to revie the
code.

>  BTW #2, why not remove #ifdef CONFIG_PCI on dgrs_cleanup_module() at the 
>  same time? Or maybe that should be in a "remove config_pci"-patch...

yup.  There are lots of opportunities for that, I bet.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-11-05 17:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-02  7:14 [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and CONFIG_PCI are not enabled Ashutosh Naik
2005-11-02  9:31 ` Richard Knutsson
2005-11-02 13:16   ` Ashutosh Naik
2005-11-02 20:55     ` Richard Knutsson
2005-11-03  5:39       ` Ashutosh Naik
2005-11-03 23:13         ` [PATCH] /drivers/net/dgrs.c - Fixes Warnings when CONFIG_EISA or " Richard Knutsson
2005-11-05  2:25       ` [PATCH]dgrs - Fixes Warnings when CONFIG_ISA and " Andrew Morton
2005-11-05  2:30         ` Andrew Morton
2005-11-05  4:51           ` Ashutosh Naik
2005-11-05  8:36           ` Richard Knutsson
2005-11-05  8:46             ` Andrew Morton
2005-11-05 11:54               ` Richard Knutsson
2005-11-05 15:29                 ` Richard Knutsson
2005-11-05 17:45                   ` Andrew Morton
2005-11-05 17:46                 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).