summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod/dev.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2021-03-10 08:21:28 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2021-03-10 08:21:28 +0000
commita7f440a7fa8ec890eb937a1c075583b1ef1a42bb (patch)
tree53ac69b0f026328183ab14e90d7a8be29b329b81 /usr.bin/sndiod/dev.c
parent0f7e30ff395004f091c8a18c9f35fc239996a957 (diff)
sndiod: Style tweak: swap if/else code blocks in slot_new()
Diffstat (limited to 'usr.bin/sndiod/dev.c')
-rw-r--r--usr.bin/sndiod/dev.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c
index 8754bfb422c..e011882a64e 100644
--- a/usr.bin/sndiod/dev.c
+++ b/usr.bin/sndiod/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.97 2021/03/08 09:42:50 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.98 2021/03/10 08:21:27 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -1777,23 +1777,23 @@ slot_new(struct opt *opt, unsigned int id, char *who,
bestidx = i;
}
}
- if (bestidx != DEV_NSLOT) {
- s = slot_array + bestidx;
- s->vol = MIDI_MAXCTL;
- strlcpy(s->name, name, SLOT_NAMEMAX);
- s->serial = slot_serial++;
- for (i = 0; unit[i] != NULL; i++)
- ; /* nothing */
- s->unit = i;
- s->id = id;
- goto found;
- }
- if (log_level >= 1) {
- log_puts(name);
- log_puts(": out of sub-device slots\n");
+ if (bestidx == DEV_NSLOT) {
+ if (log_level >= 1) {
+ log_puts(name);
+ log_puts(": out of sub-device slots\n");
+ }
+ return NULL;
}
- return NULL;
+
+ s = slot_array + bestidx;
+ s->vol = MIDI_MAXCTL;
+ strlcpy(s->name, name, SLOT_NAMEMAX);
+ s->serial = slot_serial++;
+ for (i = 0; unit[i] != NULL; i++)
+ ; /* nothing */
+ s->unit = i;
+ s->id = id;
found:
if ((mode & MODE_REC) && (opt->mode & MODE_MON)) {