diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-03-29 23:33:40 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-03-29 23:33:40 +0000 |
commit | a65580ffe4015aa3ff33845af072cc6d8449328c (patch) | |
tree | 440f567bdbe079c50caba2104223eaf9e8911e3b /sys/dev | |
parent | 0181b3616d9227302ce4911ebb960a51c11b31ae (diff) |
Initialize various uninitialized variables. Found by jsg@ via Clang.
Feedback from miod@ and kettenis@.
ok beck@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/cac.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/gdt_common.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/pgt.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/twe.c | 6 |
4 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index 2b459ac66f4..df4fd693049 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.35 2010/03/23 01:57:19 krw Exp $ */ +/* $OpenBSD: cac.c,v 1.36 2010/03/29 23:33:39 krw Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -893,7 +893,7 @@ int cac_create_sensors(struct cac_softc *sc) { struct device *dev; - struct scsibus_softc *ssc; + struct scsibus_softc *ssc = NULL; int i; TAILQ_FOREACH(dev, &alldevs, dv_list) { @@ -904,6 +904,7 @@ cac_create_sensors(struct cac_softc *sc) ssc = (struct scsibus_softc *)dev; if (ssc->adapter_link == &sc->sc_link) break; + ssc = NULL; } if (ssc == NULL) diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index 8f2853d3f7b..e5f93a7c461 100644 --- a/sys/dev/ic/gdt_common.c +++ b/sys/dev/ic/gdt_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.48 2010/03/23 01:57:19 krw Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.49 2010/03/29 23:33:39 krw Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -671,7 +671,9 @@ gdt_scsi_cmd(struct scsi_xfer *xs) */ sc->sc_cmd_off = 0; - if (xs->cmd->opcode != SYNCHRONIZE_CACHE) { + if (xs->cmd->opcode == SYNCHRONIZE_CACHE) { + blockno = blockcnt = 0; + } else { /* A read or write operation. */ if (xs->cmdlen == 6) { rw = (struct scsi_rw *)xs->cmd; diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index 25d69a638f7..afc75aaf266 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgt.c,v 1.56 2009/12/30 01:24:54 chl Exp $ */ +/* $OpenBSD: pgt.c,v 1.57 2010/03/29 23:33:39 krw Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -3199,6 +3199,8 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue pq) case PGT_QUEUE_MGMT_TX: qsize = PGT_QUEUE_MGMT_SIZE; break; + default: + return (EINVAL); } for (i = 0; i < qsize; i++) { diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c index dd0d0c6d21d..e65f60fd715 100644 --- a/sys/dev/ic/twe.c +++ b/sys/dev/ic/twe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: twe.c,v 1.34 2010/03/23 01:57:20 krw Exp $ */ +/* $OpenBSD: twe.c,v 1.35 2010/03/29 23:33:39 krw Exp $ */ /* * Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved. @@ -864,7 +864,9 @@ twe_scsi_cmd(xs) lock = TWE_LOCK(sc); flags = 0; - if (xs->cmd->opcode != SYNCHRONIZE_CACHE) { + if (xs->cmd->opcode == SYNCHRONIZE_CACHE) { + blockno = blockcnt = 0; + } else { /* A read or write operation. */ if (xs->cmdlen == 6) { rw = (struct scsi_rw *)xs->cmd; |