summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-07-24 12:43:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-07-24 12:43:33 +0000
commit8d84e6a4e7a5f0bd3d0a76a78a589398b82682f5 (patch)
tree77fa066862bec61cd8ade1996d71b5fbc6e376ba /sys/dev/ic
parent3fb25c97b24aa3b863512c9d00ae75e00876e349 (diff)
Turning on various scsi drivers' *DEBUG options reveals that this has
rarely (if ever) been done. Fix many printf format errors to calm clang and gcc on amd64, i386, hppa. Missing #include, complaints if 'option <blah>DEBUG' is used in config files, etc. All in debug code.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/adv.c10
-rw-r--r--sys/dev/ic/aic79xx.c4
-rw-r--r--sys/dev/ic/ami.c6
-rw-r--r--sys/dev/ic/cac.c6
-rw-r--r--sys/dev/ic/ciss.c6
-rw-r--r--sys/dev/ic/gdt_common.c4
-rw-r--r--sys/dev/ic/mfi.c24
-rw-r--r--sys/dev/ic/osiop.c4
-rw-r--r--sys/dev/ic/qlw.c4
-rw-r--r--sys/dev/ic/siop.c6
-rw-r--r--sys/dev/ic/twe.c4
-rw-r--r--sys/dev/ic/uha.c6
12 files changed, 43 insertions, 41 deletions
diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c
index 151d456c189..a786ea62213 100644
--- a/sys/dev/ic/adv.c
+++ b/sys/dev/ic/adv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adv.c,v 1.48 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: adv.c,v 1.49 2020/07/24 12:43:31 krw Exp $ */
/* $NetBSD: adv.c,v 1.6 1998/10/28 20:39:45 dante Exp $ */
/*
@@ -628,8 +628,8 @@ adv_scsi_cmd(xs)
#ifdef ASC_DEBUG
printf("id = %d, lun = %d, cmd = %d, ccb = 0x%lX \n",
- sc_link->scsipi_scsi.target,
- sc_link->scsipi_scsi.lun, xs->cmd->opcode,
+ sc_link->target,
+ sc_link->lun, xs->cmd->opcode,
(unsigned long)ccb);
#endif
/*
@@ -783,8 +783,8 @@ adv_narrow_isr_callback(sc, qdonep)
#ifdef ASC_DEBUG
printf(" - ccb=0x%lx, id=%d, lun=%d, cmd=%d, ",
(unsigned long)ccb,
- xs->sc_link->scsipi_scsi.target,
- xs->sc_link->scsipi_scsi.lun, xs->cmd->opcode);
+ xs->sc_link->target,
+ xs->sc_link->lun, xs->cmd->opcode);
#endif
timeout_del(&xs->stimeout);
diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c
index 45e85b3a29b..b47a5fe8ddf 100644
--- a/sys/dev/ic/aic79xx.c
+++ b/sys/dev/ic/aic79xx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx.c,v 1.65 2019/01/31 18:01:14 millert Exp $ */
+/* $OpenBSD: aic79xx.c,v 1.66 2020/07/24 12:43:31 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -1376,7 +1376,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
ahd_lookup_phase_entry(lastphase)->phasemsg,
SCB_GET_TAG(scb));
ahd_print_path(ahd, scb);
- printf("%s seen Data Phase. Length = %ld. "
+ printf("%s seen Data Phase. Length = %d. "
"NumSGs = %d.\n",
ahd_inb(ahd, SEQ_FLAGS) & DPHASE
? "Have" : "Haven't",
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index 1e7858cd399..27afb327b13 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.253 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: ami.c,v 1.254 2020/07/24 12:43:31 krw Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -210,14 +210,14 @@ ami_read(struct ami_softc *sc, bus_size_t r)
BUS_SPACE_BARRIER_READ);
rv = bus_space_read_4(sc->sc_iot, sc->sc_ioh, r);
- AMI_DPRINTF(AMI_D_CMD, ("ari 0x%x 0x08%x ", r, rv));
+ AMI_DPRINTF(AMI_D_CMD, ("ari 0x%lx 0x08%x ", r, rv));
return (rv);
}
void
ami_write(struct ami_softc *sc, bus_size_t r, u_int32_t v)
{
- AMI_DPRINTF(AMI_D_CMD, ("awo 0x%x 0x%08x ", r, v));
+ AMI_DPRINTF(AMI_D_CMD, ("awo 0x%lx 0x%08x ", r, v));
bus_space_write_4(sc->sc_iot, sc->sc_ioh, r, v);
bus_space_barrier(sc->sc_iot, sc->sc_ioh, r, 4,
diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c
index 54bd15d6257..06f97468eae 100644
--- a/sys/dev/ic/cac.c
+++ b/sys/dev/ic/cac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cac.c,v 1.65 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: cac.c,v 1.66 2020/07/24 12:43:31 krw Exp $ */
/* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */
/*
@@ -746,7 +746,7 @@ void
cac_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb)
{
#ifdef CAC_DEBUG
- printf("submit-%x ", ccb->ccb_paddr);
+ printf("submit-%lx ", ccb->ccb_paddr);
#endif
bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap, 0,
sc->sc_dmamap->dm_mapsize,
@@ -764,7 +764,7 @@ cac_l0_completed(sc)
if (!(off = cac_inl(sc, CAC_REG_DONE_FIFO)))
return NULL;
#ifdef CAC_DEBUG
- printf("compl-%x ", off);
+ printf("compl-%lx ", off);
#endif
orig_off = off;
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c
index 2af41f73f07..22118fad044 100644
--- a/sys/dev/ic/ciss.c
+++ b/sys/dev/ic/ciss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciss.c,v 1.87 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: ciss.c,v 1.88 2020/07/24 12:43:31 krw Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -468,7 +468,7 @@ ciss_cmd(struct ciss_ccb *ccb, int flags, int wait)
cmd->sgin = dmap->dm_nsegs;
sgd = dmap->dm_segs;
- CISS_DPRINTF(CISS_D_DMA, ("data=%p/%u<0x%lx/%u",
+ CISS_DPRINTF(CISS_D_DMA, ("data=%p/%zu<0x%lx/%lu",
ccb->ccb_data, ccb->ccb_len, sgd->ds_addr, sgd->ds_len));
for (i = 0; i < dmap->dm_nsegs; sgd++, i++) {
@@ -479,7 +479,7 @@ ciss_cmd(struct ciss_ccb *ccb, int flags, int wait)
cmd->sgl[i].flags = htole32(0);
if (i)
CISS_DPRINTF(CISS_D_DMA,
- (",0x%lx/%u", sgd->ds_addr, sgd->ds_len));
+ (",0x%lx/%lu", sgd->ds_addr, sgd->ds_len));
}
CISS_DPRINTF(CISS_D_DMA, ("> "));
diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c
index c33c20f3c15..380a6456d5c 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.76 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: gdt_common.c,v 1.77 2020/07/24 12:43:31 krw Exp $ */
/*
* Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved.
@@ -811,7 +811,7 @@ gdt_exec_ccb(struct gdt_ccb *ccb)
GDT_SG_LEN,
xfer->dm_segs[i].ds_len);
GDT_DPRINTF(GDT_D_IO,
- ("#%d va %p pa %p len %x\n", i, buf,
+ ("#%d pa %lx len %lx\n", i,
xfer->dm_segs[i].ds_addr,
xfer->dm_segs[i].ds_len));
}
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index efdc3dcdfbf..71e1bfead8b 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.184 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: mfi.c,v 1.185 2020/07/24 12:43:31 krw Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -284,7 +284,7 @@ mfi_init_ccb(struct mfi_softc *sc)
}
DNPRINTF(MFI_D_CCB,
- "ccb(%d): %p frame: %#x (%#x) sense: %#x (%#x) map: %#x\n",
+ "ccb(%d): %p frame: %p (%#lx) sense: %p (%#lx) map: %p\n",
ccb->ccb_frame->mfr_header.mfh_context, ccb,
ccb->ccb_frame, ccb->ccb_pframe,
ccb->ccb_sense, ccb->ccb_psense,
@@ -314,14 +314,14 @@ mfi_read(struct mfi_softc *sc, bus_size_t r)
BUS_SPACE_BARRIER_READ);
rv = bus_space_read_4(sc->sc_iot, sc->sc_ioh, r);
- DNPRINTF(MFI_D_RW, "%s: mr 0x%x 0x08%x ", DEVNAME(sc), r, rv);
+ DNPRINTF(MFI_D_RW, "%s: mr 0x%lx 0x08%x ", DEVNAME(sc), r, rv);
return (rv);
}
void
mfi_write(struct mfi_softc *sc, bus_size_t r, uint32_t v)
{
- DNPRINTF(MFI_D_RW, "%s: mw 0x%x 0x%08x", DEVNAME(sc), r, v);
+ DNPRINTF(MFI_D_RW, "%s: mw 0x%lx 0x%08x", DEVNAME(sc), r, v);
bus_space_write_4(sc->sc_iot, sc->sc_ioh, r, v);
bus_space_barrier(sc->sc_iot, sc->sc_ioh, r, 4,
@@ -334,7 +334,7 @@ mfi_allocmem(struct mfi_softc *sc, size_t size)
struct mfi_mem *mm;
int nsegs;
- DNPRINTF(MFI_D_MEM, "%s: mfi_allocmem: %d\n", DEVNAME(sc),
+ DNPRINTF(MFI_D_MEM, "%s: mfi_allocmem: %zu\n", DEVNAME(sc),
size);
mm = malloc(sizeof(struct mfi_mem), M_DEVBUF, M_NOWAIT|M_ZERO);
@@ -359,7 +359,7 @@ mfi_allocmem(struct mfi_softc *sc, size_t size)
BUS_DMA_NOWAIT) != 0)
goto unmap;
- DNPRINTF(MFI_D_MEM, " kva: %p dva: %p map: %p\n",
+ DNPRINTF(MFI_D_MEM, " kva: %p dva: %lx map: %p\n",
mm->am_kva, mm->am_map->dm_segs[0].ds_addr, mm->am_map);
return (mm);
@@ -973,7 +973,7 @@ mfi_intr(void *arg)
producer = letoh32(pcq->mpc_producer);
consumer = letoh32(pcq->mpc_consumer);
- DNPRINTF(MFI_D_INTR, "%s: mfi_intr %#x %#x\n", DEVNAME(sc), sc, pcq);
+ DNPRINTF(MFI_D_INTR, "%s: mfi_intr %p %p\n", DEVNAME(sc), sc, pcq);
while (consumer != producer) {
DNPRINTF(MFI_D_INTR, "%s: mfi_intr pi %#x ci %#x\n",
@@ -1056,7 +1056,7 @@ mfi_scsi_xs_done(struct mfi_softc *sc, struct mfi_ccb *ccb)
struct scsi_xfer *xs = ccb->ccb_cookie;
struct mfi_frame_header *hdr = &ccb->ccb_frame->mfr_header;
- DNPRINTF(MFI_D_INTR, "%s: mfi_scsi_xs_done %#x %#x\n",
+ DNPRINTF(MFI_D_INTR, "%s: mfi_scsi_xs_done %p %p\n",
DEVNAME(sc), ccb, ccb->ccb_frame);
switch (hdr->mfh_cmd_status) {
@@ -1077,13 +1077,13 @@ mfi_scsi_xs_done(struct mfi_softc *sc, struct mfi_ccb *ccb)
default:
xs->error = XS_DRIVER_STUFFUP;
- DPRINTF(MFI_D_CMD,
+ DNPRINTF(MFI_D_CMD,
"%s: mfi_scsi_xs_done stuffup %02x on %02x\n",
DEVNAME(sc), hdr->mfh_cmd_status, xs->cmd->opcode);
if (hdr->mfh_scsi_status != 0) {
DNPRINTF(MFI_D_INTR,
- "%s: mfi_scsi_xs_done sense %#x %x %x\n",
+ "%s: mfi_scsi_xs_done sense %#x %p %p\n",
DEVNAME(sc), hdr->mfh_scsi_status,
&xs->sense, ccb->ccb_sense);
memset(&xs->sense, 0, sizeof(xs->sense));
@@ -1250,7 +1250,7 @@ mfi_default_sgd_load(struct mfi_softc *sc, struct mfi_ccb *ccb)
if (sc->sc_64bit_dma) {
sgl->sg64[i].addr = htole64(sgd[i].ds_addr);
sgl->sg64[i].len = htole32(sgd[i].ds_len);
- DNPRINTF(MFI_D_DMA, "%s: addr: %#x len: %#x\n",
+ DNPRINTF(MFI_D_DMA, "%s: addr: %#llx len: %#x\n",
DEVNAME(sc), sgl->sg64[i].addr, sgl->sg64[i].len);
} else {
sgl->sg32[i].addr = htole32(sgd[i].ds_addr);
@@ -1270,7 +1270,7 @@ mfi_create_sgl(struct mfi_softc *sc, struct mfi_ccb *ccb, int flags)
struct mfi_frame_header *hdr = &ccb->ccb_frame->mfr_header;
int error;
- DNPRINTF(MFI_D_DMA, "%s: mfi_create_sgl %#x\n", DEVNAME(sc),
+ DNPRINTF(MFI_D_DMA, "%s: mfi_create_sgl %p\n", DEVNAME(sc),
ccb->ccb_data);
if (!ccb->ccb_data) {
diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c
index 482e583bd04..abf980a07f3 100644
--- a/sys/dev/ic/osiop.c
+++ b/sys/dev/ic/osiop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osiop.c,v 1.61 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: osiop.c,v 1.62 2020/07/24 12:43:31 krw Exp $ */
/* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */
/*
@@ -1975,7 +1975,7 @@ osiop_dump_acb(acb)
}
b = (u_int8_t *)&acb->ds->scsi_cmd;
- printf("(%d:%d) status %2x cmdlen %2ld cmd ",
+ printf("(%d:%d) status %2x cmdlen %2u cmd ",
acb->xs->sc_link->target,
acb->xs->sc_link->lun,
acb->status,
diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c
index feb4925c952..eacbe402c13 100644
--- a/sys/dev/ic/qlw.c
+++ b/sys/dev/ic/qlw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlw.c,v 1.44 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: qlw.c,v 1.45 2020/07/24 12:43:31 krw Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -39,8 +39,10 @@
#include <dev/ic/qlwvar.h>
#ifndef SMALL_KERNEL
+#ifndef QLW_DEBUG
#define QLW_DEBUG
#endif
+#endif
#ifdef QLW_DEBUG
#define DPRINTF(m, f...) do { if ((qlwdebug & (m)) == (m)) printf(f); } \
diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c
index 551ffed6a8b..594122513ec 100644
--- a/sys/dev/ic/siop.c
+++ b/sys/dev/ic/siop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siop.c,v 1.83 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: siop.c,v 1.84 2020/07/24 12:43:31 krw Exp $ */
/* $NetBSD: siop.c,v 1.79 2005/11/18 23:10:32 bouyer Exp $ */
/*
@@ -1927,8 +1927,8 @@ siop_morecbd(sc)
TAILQ_INSERT_TAIL(&sc->free_list, &newcbd->cmds[i], next);
splx(s);
#ifdef SIOP_DEBUG
- printf("tables[%d]: in=0x%x out=0x%x status=0x%x "
- "offset=0x%x\n", i,
+ printf("tables[%d]: in=0x%x out=0x%x status=0x%x\n",
+ i,
siop_ctoh32(&sc->sc_c,
newcbd->cmds[i].cmd_tables->t_msgin.addr),
siop_ctoh32(&sc->sc_c,
diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c
index c0f69cfcd23..a8e21821f9c 100644
--- a/sys/dev/ic/twe.c
+++ b/sys/dev/ic/twe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: twe.c,v 1.57 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: twe.c,v 1.58 2020/07/24 12:43:31 krw Exp $ */
/*
* Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved.
@@ -574,7 +574,7 @@ twe_cmd(ccb, flags, wait)
for (i = 0; i < dmap->dm_nsegs; i++, sgp++) {
sgp->twes_addr = htole32(dmap->dm_segs[i].ds_addr);
sgp->twes_len = htole32(dmap->dm_segs[i].ds_len);
- TWE_DPRINTF(TWE_D_DMA, ("%x[%x] ",
+ TWE_DPRINTF(TWE_D_DMA, ("%lx[%lx] ",
dmap->dm_segs[i].ds_addr,
dmap->dm_segs[i].ds_len));
}
diff --git a/sys/dev/ic/uha.c b/sys/dev/ic/uha.c
index 03c3ebfe05c..bae72eef21e 100644
--- a/sys/dev/ic/uha.c
+++ b/sys/dev/ic/uha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uha.c,v 1.36 2020/07/20 14:41:13 krw Exp $ */
+/* $OpenBSD: uha.c,v 1.37 2020/07/24 12:43:31 krw Exp $ */
/* $NetBSD: uha.c,v 1.3 1996/10/13 01:37:29 christos Exp $ */
#undef UHADEBUG
@@ -314,7 +314,7 @@ uha_scsi_cmd(xs)
* Set up the scatter gather block
*/
SC_DEBUG(sc_link, SDEV_DB4,
- ("%d @0x%x:- ", xs->datalen, xs->data));
+ ("%d @%p- ", xs->datalen, xs->data));
datalen = xs->datalen;
thiskv = (int) xs->data;
thisphys = KVTOPHYS(thiskv);
@@ -325,7 +325,7 @@ uha_scsi_cmd(xs)
/* put in the base address */
sg->seg_addr = thisphys;
- SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+ SC_DEBUGN(sc_link, SDEV_DB4, ("0x%lx", thisphys));
/* do it at least once */
nextphys = thisphys;