public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [2.4.20-rc1] compiler fix drivers/ide/pdc202xx.c
@ 2002-11-10 21:11 Daniel Mehrmann
  2002-11-11 11:49 ` Henning P. Schmiedehausen
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mehrmann @ 2002-11-10 21:11 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: lkm

Hello Marcelo,

i fix a compiler warning from pdc202xx.c.
The "default:" value in the switch was empty. Gcc don`t like
this. We don`t need this one. 

error:
gcc -D__KERNEL__ -I/usr/src/bk/work-2.4/include -Wall 
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing 
-fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 
-march=athlon-tbird    -nostdinc -iwithprefix include 
-DKBUILD_BASENAME=pdc202xx  -c -o pdc202xx.o pdc202xx.c
pdc202xx.c: In function `pdc202xx_new_tune_chipset':
pdc202xx.c:636: warning: deprecated use of label at end of compound 
statement

patch:
daniel@deepblue:/usr/src/bk/linux-2.4/drivers/ide$ diff -Pu 
pdc202xx.c pdc202xx.c.fine
--- pdc202xx.c  2002-11-03 04:55:30.000000000 +0100
+++ pdc202xx.c.fine     2002-11-10 21:55:43.000000000 +0100
@@ -632,11 +632,10 @@
                                        OUT_BYTE((0x13 + adj), 
indexreg);
                                        OUT_BYTE(0xac, datareg);
                                        break;
-                               default:
                        }
                }
        }
       return err;
 }

greetings,
Daniel



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

* Re: [PATCH] [2.4.20-rc1] compiler fix drivers/ide/pdc202xx.c
  2002-11-10 21:11 [PATCH] [2.4.20-rc1] compiler fix drivers/ide/pdc202xx.c Daniel Mehrmann
@ 2002-11-11 11:49 ` Henning P. Schmiedehausen
  2002-11-11 15:02   ` Horst von Brand
  0 siblings, 1 reply; 4+ messages in thread
From: Henning P. Schmiedehausen @ 2002-11-11 11:49 UTC (permalink / raw)
  To: linux-kernel

Daniel Mehrmann <daniel.mehrmann@gmx.de> writes:

>Hello Marcelo,

>i fix a compiler warning from pdc202xx.c.
>The "default:" value in the switch was empty. Gcc don`t like
>this. We don`t need this one. 

Correct solution is not to remove the "default:" but to add a "break;"

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

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

* Re: [PATCH] [2.4.20-rc1] compiler fix drivers/ide/pdc202xx.c
  2002-11-11 11:49 ` Henning P. Schmiedehausen
@ 2002-11-11 15:02   ` Horst von Brand
  2002-11-11 23:14     ` Henning P. Schmiedehausen
  0 siblings, 1 reply; 4+ messages in thread
From: Horst von Brand @ 2002-11-11 15:02 UTC (permalink / raw)
  To: hps; +Cc: linux-kernel

"Henning P. Schmiedehausen" <hps@intermeta.de> said:
> Daniel Mehrmann <daniel.mehrmann@gmx.de> writes:
> 
> >Hello Marcelo,
> 
> >i fix a compiler warning from pdc202xx.c.
> >The "default:" value in the switch was empty. Gcc don`t like
> >this. We don`t need this one. 
> 
> Correct solution is not to remove the "default:" but to add a "break;"

So people start wondering if somehow the content of the default case got
deleted by mistake? Better not. Plus it is needless (source) code bloat.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

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

* Re: [PATCH] [2.4.20-rc1] compiler fix drivers/ide/pdc202xx.c
  2002-11-11 15:02   ` Horst von Brand
@ 2002-11-11 23:14     ` Henning P. Schmiedehausen
  0 siblings, 0 replies; 4+ messages in thread
From: Henning P. Schmiedehausen @ 2002-11-11 23:14 UTC (permalink / raw)
  To: linux-kernel

Horst von Brand <vonbrand@inf.utfsm.cl> writes:

>"Henning P. Schmiedehausen" <hps@intermeta.de> said:
>> Daniel Mehrmann <daniel.mehrmann@gmx.de> writes:
>> 
>> >Hello Marcelo,
>> 
>> >i fix a compiler warning from pdc202xx.c.
>> >The "default:" value in the switch was empty. Gcc don`t like
>> >this. We don`t need this one. 
>> 
>> Correct solution is not to remove the "default:" but to add a "break;"

>So people start wondering if somehow the content of the default case got
>deleted by mistake? Better not. Plus it is needless (source) code bloat.

So comment it:

	default:
		break;  /* Does nothing */

A switch without a default case is simply asking for trouble in the
long run.

	Regards
		Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

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

end of thread, other threads:[~2002-11-11 23:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-10 21:11 [PATCH] [2.4.20-rc1] compiler fix drivers/ide/pdc202xx.c Daniel Mehrmann
2002-11-11 11:49 ` Henning P. Schmiedehausen
2002-11-11 15:02   ` Horst von Brand
2002-11-11 23:14     ` Henning P. Schmiedehausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox