* [Patch] Fix dead code in cdrom/gscd.c
@ 2006-03-08 9:07 Eric Sesterhenn
2006-03-08 11:37 ` Daniel K.
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sesterhenn @ 2006-03-08 9:07 UTC (permalink / raw)
To: linux-kernel; +Cc: raupach
hi,
this fixes Coverity Bugs #21 and #22. In both cases the
do { ... } while (result != 6 || result == 0x0E) just
finishes for result == 6, so the if(result != 6) doesnt
make much sense.
This patch simply removes the if statement, so the logic
stays the same.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.16-rc5-mm1/drivers/cdrom/gscd.c.orig 2006-03-08 09:56:30.000000000 +0100
+++ linux-2.6.16-rc5-mm1/drivers/cdrom/gscd.c 2006-03-08 09:58:18.000000000 +0100
@@ -695,10 +695,6 @@ static void cmd_read_b(char *pb, int cou
result = wait_drv_ready();
} while (result != 6 || result == 0x0E);
- if (result != 6) {
- cmd_end();
- return;
- }
#ifdef GSCD_DEBUG
printk("LOC_191 ");
#endif
@@ -763,11 +759,6 @@ static void cmd_read_w(char *pb, int cou
result = wait_drv_ready();
} while (result != 6 || result == 0x0E);
- if (result != 6) {
- cmd_end();
- return;
- }
-
for (i = 0; i < size; i++) {
/* na, hier muss ich noch mal drueber nachdenken */
*pb = inw(GSCDPORT(2));
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Patch] Fix dead code in cdrom/gscd.c
2006-03-08 9:07 [Patch] Fix dead code in cdrom/gscd.c Eric Sesterhenn
@ 2006-03-08 11:37 ` Daniel K.
0 siblings, 0 replies; 2+ messages in thread
From: Daniel K. @ 2006-03-08 11:37 UTC (permalink / raw)
To: Eric Sesterhenn; +Cc: linux-kernel, raupach
Eric Sesterhenn wrote:
> hi,
>
> this fixes Coverity Bugs #21 and #22. In both cases the
> do { ... } while (result != 6 || result == 0x0E) just
This is completely wrong, and should be fixed too.
Either
do { ... } while (result != 6)
is correct, or this is the result of a thinko, and it should be
do { ... } while (result != 6 && result != 0x0E)
in which case your patch is incorrect.
> finishes for result == 6, so the if(result != 6) doesnt
> make much sense.
Unless its presence is an indication of faulty logic in the while clause
Daniel K.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-03-08 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-08 9:07 [Patch] Fix dead code in cdrom/gscd.c Eric Sesterhenn
2006-03-08 11:37 ` Daniel K.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox