summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-08-17 15:31:41 +0000
committerkrw <krw@openbsd.org>2019-08-17 15:31:41 +0000
commitf7a04f0ff9e5b45d19920d7cf12d9f747e50146c (patch)
treef3e2d9ae6026144d24d7031e82809e7b30eba16a /sys
parentsome cleanup: (diff)
downloadwireguard-openbsd-f7a04f0ff9e5b45d19920d7cf12d9f747e50146c.tar.xz
wireguard-openbsd-f7a04f0ff9e5b45d19920d7cf12d9f747e50146c.zip
Nuke some unused variables, tweak some declarations and
variable names into a consistant idiom.
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/cd.c5
-rw-r--r--sys/scsi/mpath_emc.c5
-rw-r--r--sys/scsi/mpath_hds.c5
-rw-r--r--sys/scsi/mpath_rdac.c5
-rw-r--r--sys/scsi/mpath_sym.c5
-rw-r--r--sys/scsi/scsiconf.c28
-rw-r--r--sys/scsi/st.c5
7 files changed, 26 insertions, 32 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index c9b316861bd..2337d937cf5 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.224 2019/01/20 20:28:37 krw Exp $ */
+/* $OpenBSD: cd.c,v 1.225 2019/08/17 15:31:41 krw Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -236,7 +236,6 @@ int
cdactivate(struct device *self, int act)
{
struct cd_softc *sc = (struct cd_softc *)self;
- int rv = 0;
switch (act) {
case DVACT_RESUME:
@@ -254,7 +253,7 @@ cdactivate(struct device *self, int act)
scsi_xsh_del(&sc->sc_xsh);
break;
}
- return (rv);
+ return (0);
}
int
diff --git a/sys/scsi/mpath_emc.c b/sys/scsi/mpath_emc.c
index 4a0ec263d2f..b4ddb802593 100644
--- a/sys/scsi/mpath_emc.c
+++ b/sys/scsi/mpath_emc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_emc.c,v 1.21 2015/03/14 03:38:52 jsg Exp $ */
+/* $OpenBSD: mpath_emc.c,v 1.22 2019/08/17 15:31:41 krw Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -180,7 +180,6 @@ int
emc_activate(struct device *self, int act)
{
struct emc_softc *sc = (struct emc_softc *)self;
- int rv = 0;
switch (act) {
case DVACT_DEACTIVATE:
@@ -188,7 +187,7 @@ emc_activate(struct device *self, int act)
mpath_path_detach(&sc->sc_path);
break;
}
- return (rv);
+ return (0);
}
void
diff --git a/sys/scsi/mpath_hds.c b/sys/scsi/mpath_hds.c
index 0b00d48d4a6..5b6a23fe106 100644
--- a/sys/scsi/mpath_hds.c
+++ b/sys/scsi/mpath_hds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_hds.c,v 1.21 2018/08/09 01:41:48 jmatthew Exp $ */
+/* $OpenBSD: mpath_hds.c,v 1.22 2019/08/17 15:31:41 krw Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -187,7 +187,6 @@ int
hds_activate(struct device *self, int act)
{
struct hds_softc *sc = (struct hds_softc *)self;
- int rv = 0;
switch (act) {
case DVACT_DEACTIVATE:
@@ -195,7 +194,7 @@ hds_activate(struct device *self, int act)
mpath_path_detach(&sc->sc_path);
break;
}
- return (rv);
+ return (0);
}
void
diff --git a/sys/scsi/mpath_rdac.c b/sys/scsi/mpath_rdac.c
index bcae6e489d1..7946ddf51d3 100644
--- a/sys/scsi/mpath_rdac.c
+++ b/sys/scsi/mpath_rdac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_rdac.c,v 1.23 2015/03/14 03:38:52 jsg Exp $ */
+/* $OpenBSD: mpath_rdac.c,v 1.24 2019/08/17 15:31:41 krw Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
@@ -245,7 +245,6 @@ int
rdac_activate(struct device *self, int act)
{
struct rdac_softc *sc = (struct rdac_softc *)self;
- int rv = 0;
switch (act) {
case DVACT_DEACTIVATE:
@@ -255,7 +254,7 @@ rdac_activate(struct device *self, int act)
mpath_path_detach(&sc->sc_path);
break;
}
- return (rv);
+ return (0);
}
void
diff --git a/sys/scsi/mpath_sym.c b/sys/scsi/mpath_sym.c
index b251a62d529..f6ebec14748 100644
--- a/sys/scsi/mpath_sym.c
+++ b/sys/scsi/mpath_sym.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_sym.c,v 1.23 2015/03/14 03:38:52 jsg Exp $ */
+/* $OpenBSD: mpath_sym.c,v 1.24 2019/08/17 15:31:41 krw Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
@@ -176,7 +176,6 @@ int
sym_activate(struct device *self, int act)
{
struct sym_softc *sc = (struct sym_softc *)self;
- int rv = 0;
switch (act) {
case DVACT_DEACTIVATE:
@@ -184,7 +183,7 @@ sym_activate(struct device *self, int act)
mpath_path_detach(&sc->sc_path);
break;
}
- return (rv);
+ return (0);
}
void
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index a5a8ec29240..e2f06809572 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.199 2019/08/14 21:02:02 krw Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.200 2019/08/17 15:31:41 krw Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -214,7 +214,7 @@ scsi_activate(struct scsibus_softc *sb, int target, int lun, int act)
int
scsi_activate_bus(struct scsibus_softc *sb, int act)
{
- int target, rv = 0, r;
+ int target, r, rv = 0;
for (target = 0; target < sb->sc_buswidth; target++) {
r = scsi_activate_target(sb, target, act);
@@ -227,7 +227,7 @@ scsi_activate_bus(struct scsibus_softc *sb, int act)
int
scsi_activate_target(struct scsibus_softc *sb, int target, int act)
{
- int lun, rv = 0, r;
+ int lun, r, rv = 0;
for (lun = 0; lun < sb->adapter_link->luns; lun++) {
r = scsi_activate_lun(sb, target, lun, act);
@@ -424,12 +424,12 @@ int
scsi_detach_bus(struct scsibus_softc *sb, int flags)
{
struct scsi_link *alink = sb->adapter_link;
- int i, err, rv = 0;
+ int target, r, rv = 0;
- for (i = 0; i < alink->adapter_buswidth; i++) {
- err = scsi_detach_target(sb, i, flags);
- if (err != 0 && err != ENXIO)
- rv = err;
+ for (target = 0; target < alink->adapter_buswidth; target++) {
+ r = scsi_detach_target(sb, target, flags);
+ if (r != 0 && r != ENXIO)
+ rv = r;
}
return (rv);
@@ -455,19 +455,19 @@ int
scsi_detach_target(struct scsibus_softc *sb, int target, int flags)
{
struct scsi_link *alink = sb->adapter_link;
- int i, err, rv = 0;
+ int lun, r, rv = 0;
if (target < 0 || target >= alink->adapter_buswidth ||
target == alink->adapter_target)
return (ENXIO);
- for (i = 0; i < alink->luns; i++) { /* nicer backwards? */
- if (scsi_get_link(sb, target, i) == NULL)
+ for (lun = 0; lun < alink->luns; lun++) { /* nicer backwards? */
+ if (scsi_get_link(sb, target, lun) == NULL)
continue;
- err = scsi_detach_lun(sb, target, i, flags);
- if (err != 0 && err != ENXIO)
- rv = err;
+ r = scsi_detach_lun(sb, target, lun, flags);
+ if (r != 0 && r != ENXIO)
+ rv = r;
}
return (rv);
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 0335175bd03..14ed0b14043 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.135 2019/01/20 03:28:19 krw Exp $ */
+/* $OpenBSD: st.c,v 1.136 2019/08/17 15:31:41 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -352,7 +352,6 @@ int
stactivate(struct device *self, int act)
{
struct st_softc *st = (struct st_softc *)self;
- int rv = 0;
switch (act) {
case DVACT_DEACTIVATE:
@@ -361,7 +360,7 @@ stactivate(struct device *self, int act)
break;
}
- return (rv);
+ return (0);
}
int