summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2004-04-28 01:45:49 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2004-04-28 01:45:49 +0000
commit1e1bac64a9bba01c7037bc48c2b966f4d7038ffa (patch)
tree73960d1136e7105bc4da8322394c35e865fc3a62 /sys
parent07d242fedc1f6c5f4c3c50d3fcf775c98db67053 (diff)
Removing some erroneous \n junk and a little KNF. ok & tested krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/mpt.c58
-rw-r--r--sys/dev/ic/mpt_openbsd.c31
2 files changed, 45 insertions, 44 deletions
diff --git a/sys/dev/ic/mpt.c b/sys/dev/ic/mpt.c
index d0df5afcf15..4cbf504dd7b 100644
--- a/sys/dev/ic/mpt.c
+++ b/sys/dev/ic/mpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpt.c,v 1.5 2004/04/04 03:24:32 marco Exp $ */
+/* $OpenBSD: mpt.c,v 1.6 2004/04/28 01:45:48 marco Exp $ */
/* $NetBSD: mpt.c,v 1.4 2003/11/02 11:07:45 wiz Exp $ */
/*
@@ -223,7 +223,7 @@ mpt_hard_reset(mpt_softc_t *mpt)
/* wait for the adapter to finish the reset */
for (count = 0; count < 30; count++) {
diag0 = mpt_read(mpt, MPI_DIAGNOSTIC_OFFSET);
- mpt_prt(mpt, "diag0=%08x\n", diag0);
+ mpt_prt(mpt, "diag0=%08x", diag0);
if (!(diag0 & MPI_DIAG_RESET_ADAPTER)) {
break;
}
@@ -233,8 +233,7 @@ mpt_hard_reset(mpt_softc_t *mpt)
}
count = mpt_downloadboot(mpt);
if (count < 0) {
- panic("firmware downloadboot failure (%d)!\n",
- count);
+ panic("firmware downloadboot failure (%d)!", count);
}
}
}
@@ -270,7 +269,7 @@ void
mpt_free_request(mpt_softc_t *mpt, request_t *req)
{
if (req == NULL || req != &mpt->request_pool[req->index]) {
- panic("mpt_free_request bad req ptr\n");
+ panic("mpt_free_request bad req ptr");
return;
}
if (req->debug == REQ_FREE) {
@@ -278,7 +277,7 @@ mpt_free_request(mpt_softc_t *mpt, request_t *req)
* XXX MU this should not happen but do not corrupt the free
* list if it does
*/
- mpt_prt(mpt, "request %d already free\n", req->index);
+ mpt_prt(mpt, "request %d already free", req->index);
return;
}
req->sequence = 0;
@@ -292,7 +291,7 @@ void
mpt_init_request(mpt_softc_t *mpt, request_t *req)
{
if (req == NULL || req != &mpt->request_pool[req->index]) {
- panic("mpt_init_request bad req ptr\n");
+ panic("mpt_init_request bad req ptr");
return;
}
req->sequence = 0;
@@ -308,10 +307,11 @@ mpt_get_request(mpt_softc_t *mpt)
req = SLIST_FIRST(&mpt->request_free_list);
if (req != NULL) {
if (req != &mpt->request_pool[req->index]) {
- panic("mpt_get_request: corrupted request free list\n");
+ panic("mpt_get_request: corrupted request free list");
}
if (req->xfer != NULL) {
- panic("mpt_get_request: corrupted request free list (xfer)\n");
+ panic("mpt_get_request: corrupted request free list "
+ "(xfer)");
}
SLIST_REMOVE_HEAD(&mpt->request_free_list, link);
req->debug = REQ_IN_PROGRESS;
@@ -1158,7 +1158,7 @@ mpt_init(mpt_softc_t *mpt, u_int32_t who)
if (mpt->verbose > 1) {
mpt_prt(mpt,
"IOCFACTS: GlobalCredits=%d BlockSize=%u "
- "Request Frame Size %u\n", facts.GlobalCredits,
+ "Request Frame Size %u", facts.GlobalCredits,
facts.BlockSize, facts.RequestFrameSize);
}
mpt->mpt_global_credits = facts.GlobalCredits;
@@ -1177,7 +1177,7 @@ mpt_init(mpt_softc_t *mpt, u_int32_t who)
if (mpt->verbose > 1) {
mpt_prt(mpt,
- "PORTFACTS: Type %x PFlags %x IID %d MaxDev %d\n",
+ "PORTFACTS: Type %x PFlags %x IID %d MaxDev %d",
pfp.PortType, pfp.ProtocolFlags, pfp.PortSCSIID,
pfp.MaxDevices);
}
@@ -1237,7 +1237,7 @@ mpt_init(mpt_softc_t *mpt, u_int32_t who)
if (mpt_do_upload(mpt)) {
/* XXX MP should we panic? */
- mpt_prt(mpt, "firmware upload failure!\n");
+ mpt_prt(mpt, "firmware upload failure!");
}
/* continue; */
}
@@ -1326,12 +1326,12 @@ mpt_do_upload(mpt_softc_t *mpt)
error = mpt_alloc_fw_mem(mpt, mpt->fw_image_size, maxsgl);
if (error) {
- mpt_prt(mpt,"mpt_alloc_fw_mem error: %d\n", error);
+ mpt_prt(mpt,"mpt_alloc_fw_mem error: %d", error);
return error;
}
if (mpt->fw_dmap->dm_nsegs > maxsgl) {
- mpt_prt(mpt,"nsegs > maxsgl\n");
+ mpt_prt(mpt,"nsegs > maxsgl");
return 1; /* XXX */
}
@@ -1415,7 +1415,7 @@ mpt_do_upload(mpt_softc_t *mpt)
mpt->upload_fw = 0;
}
else {
- mpt_prt(mpt, "freeing image memory\n");
+ mpt_prt(mpt, "freeing image memory");
mpt_free_fw_mem(mpt);
mpt->fw = NULL;
}
@@ -1447,19 +1447,19 @@ mpt_downloadboot(mpt_softc_t *mpt)
diag0 = mpt_read(mpt, MPT_OFFSET_DIAGNOSTIC);
if (mpt->mpt2)
diag1 = mpt_read(mpt->mpt2, MPT_OFFSET_DIAGNOSTIC);
- mpt_prt(mpt, "diag0=%08x, diag1=%08x\n", diag0, diag1);
+ mpt_prt(mpt, "diag0=%08x, diag1=%08x", diag0, diag1);
#endif
- mpt_prt(mpt, "fw size 0x%x, ioc FW ptr %p\n",
- mpt->fw_image_size, mpt->fw);
+ mpt_prt(mpt, "fw size 0x%x, ioc FW ptr %p", mpt->fw_image_size,
+ mpt->fw);
if (mpt->mpt2)
- mpt_prt(mpt->mpt2, "ioc FW ptr %p\n", mpt->mpt2->fw);
+ mpt_prt(mpt->mpt2, "ioc FW ptr %p", mpt->mpt2->fw);
fw_size = mpt->fw_image_size;
if (fw_size == 0)
return -1;
- mpt_prt(mpt, "FW Image @ %p\n", mpt->fw);
+ mpt_prt(mpt, "FW Image @ %p", mpt->fw);
if (!mpt->fw)
return -2;
@@ -1482,7 +1482,7 @@ mpt_downloadboot(mpt_softc_t *mpt)
count++;
if (count > 20) {
- mpt_prt(mpt, "enable diagnostic mode FAILED! (%02xh)\n",
+ mpt_prt(mpt, "enable diagnostic mode FAILED! (%02xh)",
diag0);
return -EFAULT;
}
@@ -1491,9 +1491,9 @@ mpt_downloadboot(mpt_softc_t *mpt)
#ifdef MPT_DEBUG
if (mpt->mpt2)
diag1 = mpt_read(mpt->mpt2, MPT_OFFSET_DIAGNOSTIC);
- mpt_prt(mpt, "diag0=%08x, diag1=%08x\n", diag0, diag1);
+ mpt_prt(mpt, "diag0=%08x, diag1=%08x", diag0, diag1);
#endif
- mpt_prt(mpt, "wrote magic DiagWriteEn sequence (%x)\n", diag0);
+ mpt_prt(mpt, "wrote magic DiagWriteEn sequence (%x)", diag0);
}
/* Set the DiagRwEn and Disable ARM bits */
@@ -1503,7 +1503,7 @@ mpt_downloadboot(mpt_softc_t *mpt)
#ifdef MPT_DEBUG
if (mpt->mpt2)
diag1 = mpt_read(mpt->mpt2, MPT_OFFSET_DIAGNOSTIC);
- mpt_prt(mpt, "diag0=%08x, diag1=%08x\n", diag0, diag1);
+ mpt_prt(mpt, "diag0=%08x, diag1=%08x", diag0, diag1);
#endif
fwhdr = (MpiFwHeader_t *) mpt->fw;
@@ -1517,8 +1517,8 @@ mpt_downloadboot(mpt_softc_t *mpt)
*/
mpt_write(mpt, MPT_OFFSET_RWADDR, fwhdr->LoadStartAddress);
- mpt_prt(mpt, "LoadStart addr written 0x%x \n", fwhdr->LoadStartAddress);
- mpt_prt(mpt, "writing file image: 0x%x u32's @ %p\n", count, ptr);
+ mpt_prt(mpt, "LoadStart addr written 0x%x", fwhdr->LoadStartAddress);
+ mpt_prt(mpt, "writing file image: 0x%x u32's @ %p", count, ptr);
while (count--) {
mpt_write(mpt, MPT_OFFSET_RWDATA, *ptr);
@@ -1532,7 +1532,7 @@ mpt_downloadboot(mpt_softc_t *mpt)
nextimg = exthdr->NextImageHeaderOffset;
load_addr = exthdr->LoadStartAddress;
- mpt_prt(mpt, "write ext image: 0x%x u32's @ %p\n", count, ptr);
+ mpt_prt(mpt, "write ext image: 0x%x u32's @ %p", count, ptr);
mpt_write(mpt, MPT_OFFSET_RWADDR, load_addr);
@@ -1543,11 +1543,11 @@ mpt_downloadboot(mpt_softc_t *mpt)
}
/* write the IopResetVectorRegAddr */
- mpt_prt(mpt, "write IopResetVector addr!\n");
+ mpt_prt(mpt, "write IopResetVector addr!");
mpt_write(mpt, MPT_OFFSET_RWADDR, fwhdr->IopResetRegAddr);
/* write the IopResetVectorValue */
- mpt_prt(mpt, "write IopResetVector value!\n");
+ mpt_prt(mpt, "write IopResetVector value!");
mpt_write(mpt, MPT_OFFSET_RWDATA, fwhdr->IopResetVectorValue);
/*
diff --git a/sys/dev/ic/mpt_openbsd.c b/sys/dev/ic/mpt_openbsd.c
index d909a713004..865e92c92d6 100644
--- a/sys/dev/ic/mpt_openbsd.c
+++ b/sys/dev/ic/mpt_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpt_openbsd.c,v 1.10 2004/04/25 03:55:25 krw Exp $ */
+/* $OpenBSD: mpt_openbsd.c,v 1.11 2004/04/28 01:45:48 marco Exp $ */
/* $NetBSD: mpt_netbsd.c,v 1.7 2003/07/14 15:47:11 lukem Exp $ */
/*
@@ -264,7 +264,7 @@ mpt_ppr(mpt_softc_t *mpt, struct scsi_link *sc_link, int speed)
sizeof(scsi_cmd), (u_char *)&inqbuf, scsi_cmd.length, 0, 10000, NULL,
SCSI_DATA_IN);
if (error) {
- mpt_prt(mpt, "Invalid INQUIRY on target: %d\n", sc_link->target);
+ mpt_prt(mpt, "Invalid INQUIRY on target: %d", sc_link->target);
return 0;
}
@@ -364,7 +364,8 @@ mpt_run_ppr(mpt_softc_t *mpt)
u_int16_t buswidth;
/* walk device list */
- for (dev = TAILQ_FIRST(&alldevs); dev != NULL; dev = TAILQ_NEXT(dev, dv_list)) {
+ for (dev = TAILQ_FIRST(&alldevs); dev != NULL;
+ dev = TAILQ_NEXT(dev, dv_list)) {
if (dev->dv_parent == (struct device *)mpt) {
/* found scsibus softc */
buswidth = ((struct scsi_link *)&mpt->sc_link)->adapter_buswidth;
@@ -511,8 +512,8 @@ mpt_dma_mem_alloc(mpt_softc_t *mpt)
error = bus_dmamem_alloc(mpt->sc_dmat, MPT_REQ_MEM_SIZE(mpt),
PAGE_SIZE, 0, &request_seg, 1, &request_rseg, 0);
if (error) {
- printf("%s: unable to allocate request area, "
- "error = %d\n", mpt->mpt_dev.dv_xname, error);
+ printf("%s: unable to allocate request area, error = %d\n",
+ mpt->mpt_dev.dv_xname, error);
goto fail_4;
}
@@ -527,8 +528,8 @@ mpt_dma_mem_alloc(mpt_softc_t *mpt)
error = bus_dmamap_create(mpt->sc_dmat, MPT_REQ_MEM_SIZE(mpt), 1,
MPT_REQ_MEM_SIZE(mpt), 0, 0, &mpt->request_dmap);
if (error) {
- printf("%s: unable to create request DMA map, "
- "error = %d\n", mpt->mpt_dev.dv_xname, error);
+ printf("%s: unable to create request DMA map, error = %d\n",
+ mpt->mpt_dev.dv_xname, error);
goto fail_6;
}
@@ -562,8 +563,8 @@ mpt_dma_mem_alloc(mpt_softc_t *mpt)
error = bus_dmamap_create(mpt->sc_dmat, MAXPHYS,
MPT_SGL_MAX, MAXPHYS, 0, 0, &req->dmap);
if (error) {
- printf("%s: unable to create req %d DMA map, "
- "error = %d\n", mpt->mpt_dev.dv_xname, i, error);
+ printf("%s: unable to create req %d DMA map, error = ",
+ "%d", mpt->mpt_dev.dv_xname, i, error);
goto fail_8;
}
}
@@ -683,7 +684,7 @@ mpt_timeout(void *arg)
uint32_t oseq;
int s, index;
- mpt_prt(mpt, "command timeout\n");
+ mpt_prt(mpt, "command timeout");
sc_print_addr(linkp);
s = splbio();
@@ -916,7 +917,7 @@ mpt_done(mpt_softc_t *mpt, uint32_t reply)
break;
default:
sc_print_addr(linkp);
- printf("invalid status code %d\n", xs->status);
+ mpt_prt(mpt, "invalid status code %d", xs->status);
xs->error = XS_DRIVER_STUFFUP;
break;
}
@@ -1555,21 +1556,21 @@ mpt_alloc_fw_mem(mpt_softc_t *mpt, uint32_t img_sz, int maxsgl)
error = bus_dmamem_alloc(mpt->sc_dmat, img_sz, PAGE_SIZE, 0,
&mpt->fw_seg, maxsgl, &mpt->fw_rseg, 0);
if (error) {
- mpt_prt(mpt, "unable to allocate fw memory, error = %d\n", error);
+ mpt_prt(mpt, "unable to allocate fw memory, error = %d", error);
goto fw_fail0;
}
error = bus_dmamem_map(mpt->sc_dmat, &mpt->fw_seg, mpt->fw_rseg, img_sz,
(caddr_t *)&mpt->fw, BUS_DMA_COHERENT);
if (error) {
- mpt_prt(mpt, "unable to map fw area, error = %d\n", error);
+ mpt_prt(mpt, "unable to map fw area, error = %d", error);
goto fw_fail1;
}
error = bus_dmamap_create(mpt->sc_dmat, img_sz, maxsgl, img_sz,
0, 0, &mpt->fw_dmap);
if (error) {
- mpt_prt(mpt, "unable to create request DMA map, error = %d\n",
+ mpt_prt(mpt, "unable to create request DMA map, error = %d",
error);
goto fw_fail2;
}
@@ -1577,7 +1578,7 @@ mpt_alloc_fw_mem(mpt_softc_t *mpt, uint32_t img_sz, int maxsgl)
error = bus_dmamap_load(mpt->sc_dmat, mpt->fw_dmap, mpt->fw, img_sz,
NULL, 0);
if (error) {
- mpt_prt(mpt, "unable to load request DMA map, error = %d\n", error);
+ mpt_prt(mpt, "unable to load request DMA map, error = %d", error);
goto fw_fail3;
}