* [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix
@ 2004-06-16 13:42 Ladislav Michl
2004-07-09 22:42 ` Wolfgang Denk
0 siblings, 1 reply; 5+ messages in thread
From: Ladislav Michl @ 2004-06-16 13:42 UTC (permalink / raw)
To: u-boot
Hi, really trivial fix...
smc91111.c: In function `smc_phy_configure':
smc91111.c:1419: warning: deprecated use of label at end of compound statement
Index: drivers/smc91111.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/drivers/smc91111.c,v
retrieving revision 1.15
diff -u -p -r1.15 smc91111.c
--- drivers/smc91111.c 9 Jun 2004 14:47:55 -0000 1.15
+++ drivers/smc91111.c 16 Jun 2004 13:35:09 -0000
@@ -1322,7 +1322,7 @@ static void smc_phy_configure ()
if (timeout < 1) {
printf ("%s:PHY reset timed out\n", SMC_DEV_NAME);
- goto smc_phy_configure_exit;
+ return;
}
/* Read PHY Register 18, Status Output */
@@ -1413,9 +1413,6 @@ static void smc_phy_configure ()
/* Re-Configure the Receive/Phy Control register */
SMC_outw (RPC_DEFAULT, RPC_REG);
-
- smc_phy_configure_exit:
-
}
#endif /* !CONFIG_SMC91111_EXT_PHY */
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix
@ 2004-06-16 15:05 Woodruff, Richard
2004-06-16 16:04 ` Ladislav Michl
0 siblings, 1 reply; 5+ messages in thread
From: Woodruff, Richard @ 2004-06-16 15:05 UTC (permalink / raw)
To: u-boot
Even toward the more trivial, I believe that Wolfgang or someone pointed
out before that adding a ';' after the target goto label will also
remove the warning.
Regards,
Richard W.
> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net [mailto:u-boot-users-
> admin at lists.sourceforge.net] On Behalf Of Ladislav Michl
> Sent: Wednesday, June 16, 2004 8:43 AM
> To: u-boot-users at lists.sourceforge.net
> Subject: [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix
>
> Hi, really trivial fix...
>
> smc91111.c: In function `smc_phy_configure':
> smc91111.c:1419: warning: deprecated use of label at end of compound
> statement
>
>
> Index: drivers/smc91111.c
> ===================================================================
> RCS file: /cvsroot/u-boot/u-boot/drivers/smc91111.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 smc91111.c
> --- drivers/smc91111.c 9 Jun 2004 14:47:55 -0000 1.15
> +++ drivers/smc91111.c 16 Jun 2004 13:35:09 -0000
> @@ -1322,7 +1322,7 @@ static void smc_phy_configure ()
>
> if (timeout < 1) {
> printf ("%s:PHY reset timed out\n", SMC_DEV_NAME);
> - goto smc_phy_configure_exit;
> + return;
> }
>
> /* Read PHY Register 18, Status Output */
> @@ -1413,9 +1413,6 @@ static void smc_phy_configure ()
>
> /* Re-Configure the Receive/Phy Control register */
> SMC_outw (RPC_DEFAULT, RPC_REG);
> -
> - smc_phy_configure_exit:
> -
> }
> #endif /* !CONFIG_SMC91111_EXT_PHY */
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco,
CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code
NWMGYKND
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix
2004-06-16 15:05 Woodruff, Richard
@ 2004-06-16 16:04 ` Ladislav Michl
0 siblings, 0 replies; 5+ messages in thread
From: Ladislav Michl @ 2004-06-16 16:04 UTC (permalink / raw)
To: u-boot
On Wed, Jun 16, 2004 at 10:05:14AM -0500, Woodruff, Richard wrote:
> Even toward the more trivial, I believe that Wolfgang or someone pointed
> out before that adding a ';' after the target goto label will also
> remove the warning.
>
> Regards,
> Richard W.
Right, but I'm still considering such usage of goto ugly as hell.
ladis
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix
@ 2004-06-16 17:15 Woodruff, Richard
0 siblings, 0 replies; 5+ messages in thread
From: Woodruff, Richard @ 2004-06-16 17:15 UTC (permalink / raw)
To: u-boot
goto's while ugly do have a good usage in error unwinding. Most of the
C tomes say this and I agree... I didn't look closely at this specific
situation in the 91111 and all of it's context, but from the patch it
appeared to be an error path.
Leaving with a return may be the cleaner thing to do here. Removing
goto's is generally good, but I wouldn't go out of my way to recode in
instances when they are the most efficient way to go.
Regards,
Richard W.
> -----Original Message-----
> From: Ladislav Michl [mailto:ladis at linux-mips.org]
> Sent: Wednesday, June 16, 2004 11:05 AM
> To: Woodruff, Richard
> Cc: u-boot-users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix
>
> On Wed, Jun 16, 2004 at 10:05:14AM -0500, Woodruff, Richard wrote:
> > Even toward the more trivial, I believe that Wolfgang or someone
pointed
> > out before that adding a ';' after the target goto label will also
> > remove the warning.
> >
> > Regards,
> > Richard W.
>
> Right, but I'm still considering such usage of goto ugly as hell.
>
> ladis
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix
2004-06-16 13:42 [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix Ladislav Michl
@ 2004-07-09 22:42 ` Wolfgang Denk
0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2004-07-09 22:42 UTC (permalink / raw)
To: u-boot
In message <20040616134239.GA8269@umax645sx> you wrote:
> Hi, really trivial fix...
>
> smc91111.c: In function `smc_phy_configure':
> smc91111.c:1419: warning: deprecated use of label at end of compound statement
Fixed (but keeping the label).
Thanks for pointing out.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
You are an excellent tactician, Captain. You let your second in com-
mand attack while you sit and watch for weakness.
-- Khan Noonian Singh, "Space Seed", stardate 3141.9
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-07-09 22:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-16 13:42 [U-Boot-Users] [PATCH] smc91111.c gcc-3.3.3 warning fix Ladislav Michl
2004-07-09 22:42 ` Wolfgang Denk
-- strict thread matches above, loose matches on Subject: below --
2004-06-16 15:05 Woodruff, Richard
2004-06-16 16:04 ` Ladislav Michl
2004-06-16 17:15 Woodruff, Richard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox