summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2019-12-07 15:16:25 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2019-12-07 15:16:25 +0000
commitf18f6a38c8d6498dd188e2746b1cfd0a796b7ce3 (patch)
treebc2322873c9c190fad90e47725e7d3ae71b5f71f /sys
parentae480e2ea118f256c8f212566019f9244f02bcfb (diff)
Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,
Comment fixes.
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/scsi_ioctl.c43
-rw-r--r--sys/scsi/uk.c4
2 files changed, 23 insertions, 24 deletions
diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c
index 28fade5edfc..b3f9ac846a5 100644
--- a/sys/scsi/scsi_ioctl.c
+++ b/sys/scsi/scsi_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_ioctl.c,v 1.62 2019/11/23 17:10:13 krw Exp $ */
+/* $OpenBSD: scsi_ioctl.c,v 1.63 2019/12/07 15:16:24 krw Exp $ */
/* $NetBSD: scsi_ioctl.c,v 1.23 1996/10/12 23:23:17 christos Exp $ */
/*
@@ -97,17 +97,17 @@ const unsigned char scsi_readsafe_cmd[256] = {
int
scsi_ioc_cmd(struct scsi_link *link, scsireq_t *screq)
{
- struct scsi_xfer *xs;
- int err = 0;
+ struct scsi_xfer *xs;
+ int err = 0;
if (screq->cmdlen > sizeof(struct scsi_generic))
- return (EFAULT);
+ return EFAULT;
if (screq->datalen > MAXPHYS)
- return (EINVAL);
+ return EINVAL;
xs = scsi_xs_get(link, 0);
if (xs == NULL)
- return (ENOMEM);
+ return ENOMEM;
memcpy(xs->cmd, screq->cmd, screq->cmdlen);
xs->cmdlen = screq->cmdlen;
@@ -187,22 +187,22 @@ err:
dma_free(xs->data, screq->datalen);
scsi_xs_put(xs);
- return (err);
+ return err;
}
int
scsi_ioc_ata_cmd(struct scsi_link *link, atareq_t *atareq)
{
- struct scsi_xfer *xs;
- struct scsi_ata_passthru_12 *cdb;
- int err = 0;
+ struct scsi_xfer *xs;
+ struct scsi_ata_passthru_12 *cdb;
+ int err = 0;
if (atareq->datalen > MAXPHYS)
- return (EINVAL);
+ return EINVAL;
xs = scsi_xs_get(link, 0);
if (xs == NULL)
- return (ENOMEM);
+ return ENOMEM;
cdb = (struct scsi_ata_passthru_12 *)xs->cmd;
cdb->opcode = ATA_PASSTHRU_12;
@@ -282,7 +282,7 @@ err:
dma_free(xs->data, atareq->datalen);
scsi_xs_put(xs);
- return (err);
+ return err;
}
/*
@@ -308,7 +308,7 @@ scsi_do_ioctl(struct scsi_link *link, u_long cmd, caddr_t addr, int flag)
sca->scbus = link->bus->sc_dev.dv_unit;
sca->target = link->target;
sca->lun = link->lun;
- return (0);
+ return 0;
}
case SCIOCCOMMAND:
if (scsi_readsafe_cmd[((scsireq_t *)addr)->cmd[0]])
@@ -317,21 +317,20 @@ scsi_do_ioctl(struct scsi_link *link, u_long cmd, caddr_t addr, int flag)
case ATAIOCCOMMAND:
case SCIOCDEBUG:
if (!ISSET(flag, FWRITE))
- return (EPERM);
+ return EPERM;
break;
default:
if (link->adapter->ioctl)
- return ((link->adapter->ioctl)(link, cmd, addr,
- flag));
+ return (link->adapter->ioctl)(link, cmd, addr, flag);
else
- return (ENOTTY);
+ return ENOTTY;
}
switch(cmd) {
case SCIOCCOMMAND:
- return (scsi_ioc_cmd(link, (scsireq_t *)addr));
+ return scsi_ioc_cmd(link, (scsireq_t *)addr);
case ATAIOCCOMMAND:
- return (scsi_ioc_ata_cmd(link, (atareq_t *)addr));
+ return scsi_ioc_ata_cmd(link, (atareq_t *)addr);
case SCIOCDEBUG: {
int level = *((int *)addr);
@@ -345,12 +344,12 @@ scsi_do_ioctl(struct scsi_link *link, u_long cmd, caddr_t addr, int flag)
SET(link->flags, SDEV_DB3);
if (level & 8)
SET(link->flags, SDEV_DB4);
- return (0);
+ return 0;
}
default:
#ifdef DIAGNOSTIC
panic("scsi_do_ioctl: impossible cmd (%#lx)", cmd);
#endif /* DIAGNOSTIC */
- return (0);
+ return 0;
}
}
diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c
index 77c3dedd6a3..c43915af8c8 100644
--- a/sys/scsi/uk.c
+++ b/sys/scsi/uk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uk.c,v 1.23 2019/12/05 21:32:13 krw Exp $ */
+/* $OpenBSD: uk.c,v 1.24 2019/12/07 15:16:24 krw Exp $ */
/* $NetBSD: uk.c,v 1.15 1996/03/17 00:59:57 thorpej Exp $ */
/*
@@ -156,7 +156,7 @@ ukclose(dev_t dev, int flag, int fmt, struct proc *p)
sc = uklookup(UKUNIT(dev));
if (sc == NULL)
- return (ENXIO);
+ return ENXIO;
SC_DEBUG(sc->sc_link, SDEV_DB1, ("closing\n"));
CLR(sc->sc_link->flags, SDEV_OPEN);