From 7ce513a52a1d9c45f22446dbea578a6f3c747efa Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Thu, 10 Jun 2010 17:49:36 +0000 Subject: [PATCH] Untangle g_print_bio(), silencing Coverity. Found with: Coverity Prevent CID: 3566, 3567 --- sys/geom/geom_io.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c index 1090c0bbf667..b145441cad75 100644 --- a/sys/geom/geom_io.c +++ b/sys/geom/geom_io.c @@ -779,19 +779,18 @@ g_print_bio(struct bio *bp) return; case BIO_READ: cmd = "READ"; + break; case BIO_WRITE: - if (cmd == NULL) - cmd = "WRITE"; + cmd = "WRITE"; + break; case BIO_DELETE: - if (cmd == NULL) - cmd = "DELETE"; - printf("%s[%s(offset=%jd, length=%jd)]", pname, cmd, - (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length); - return; + cmd = "DELETE"; + break; default: cmd = "UNKNOWN"; printf("%s[%s()]", pname, cmd); return; } - /* NOTREACHED */ + printf("%s[%s(offset=%jd, length=%jd)]", pname, cmd, + (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length); }