public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: raupach@nwfs1.rz.fh-hannover.de
Subject: [Patch] Fix dead code in cdrom/gscd.c
Date: Wed, 08 Mar 2006 10:07:51 +0100	[thread overview]
Message-ID: <1141808871.6355.5.camel@alice> (raw)

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));



             reply	other threads:[~2006-03-08  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-08  9:07 Eric Sesterhenn [this message]
2006-03-08 11:37 ` [Patch] Fix dead code in cdrom/gscd.c Daniel K.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1141808871.6355.5.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raupach@nwfs1.rz.fh-hannover.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox