2002-07-22 10:49:43

by Marcin Dalecki

[permalink] [raw]
Subject: [PATCH] 2.5.27 smbiod

diff -urN linux-2.5.27/fs/smbfs/smbiod.c linux/fs/smbfs/smbiod.c
--- linux-2.5.27/fs/smbfs/smbiod.c 2002-07-20 21:11:26.000000000 +0200
+++ linux/fs/smbfs/smbiod.c 2002-07-22 01:39:05.000000000 +0200
@@ -233,14 +233,14 @@
int maxwork = 7;

if (server->state != CONN_VALID)
- goto out;
+ return;

do {
result = smb_request_recv(server);
if (result < 0) {
server->state = CONN_INVALID;
smbiod_retry(server);
- goto out; /* reconnecting is slow */
+ return; /* reconnecting is slow */
} else if (server->rstate == SMB_RECV_REQUEST)
smbiod_handle_request(server);
} while (result > 0 && maxwork-- > 0);
@@ -249,7 +249,7 @@
* If there is more to read then we want to be sure to wake up again.
*/
if (server->state != CONN_VALID)
- goto out;
+ return;
if (smb_recv_available(server) > 0)
set_bit(SMBIOD_DATA_READY, &smbiod_flags);

@@ -258,7 +258,7 @@
if (result < 0) {
server->state = CONN_INVALID;
smbiod_retry(server);
- goto out; /* reconnecting is slow */
+ return; /* reconnecting is slow */
}
} while (result > 0);

@@ -267,8 +267,6 @@
*/
if (!list_empty(&server->xmitq))
set_bit(SMBIOD_DATA_READY, &smbiod_flags);
-
-out:
}

/*


Attachments:
smbiod-2.5.27.diff (1.19 kB)

2002-07-22 22:27:02

by Albert D. Cahalan

[permalink] [raw]
Subject: Re: [PATCH] 2.5.27 smbiod

Marcin Dalecki writes:

> Fix label at block end warning - don't write "assembler code".
...
> if (server->state != CONN_VALID)
> - goto out;
> + return;
...
> -
> -out:
> }


Assembler? No, that would be Pascal. Many would argue
that a return out of the middle is as ugly as a goto.

Maybe it doesn't matter, and maybe you did actually
improve the code generation, but there's an obvious
way to ditch the warning without changing so much.
Note the semicolon:

out:;
}