summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2024-04-22 10:43:56 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2024-04-22 10:43:56 +0000
commit14889cd96e524db28ade2f19840bb7311ff0b793 (patch)
treec609350dc4c59c6c5c4bfda4681639fcff9f41c8 /usr.bin/sndiod
parent1d006a5003cb0b20a6458ba3174ce086ae839cc1 (diff)
sndiod: Hide forgotten debug printfs
Diffstat (limited to 'usr.bin/sndiod')
-rw-r--r--usr.bin/sndiod/dev_sioctl.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/usr.bin/sndiod/dev_sioctl.c b/usr.bin/sndiod/dev_sioctl.c
index 45f6f5f641f..907f49267b0 100644
--- a/usr.bin/sndiod/dev_sioctl.c
+++ b/usr.bin/sndiod/dev_sioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev_sioctl.c,v 1.7 2021/03/03 10:00:27 ratchov Exp $ */
+/* $OpenBSD: dev_sioctl.c,v 1.8 2024/04/22 10:43:55 ratchov Exp $ */
/*
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
*
@@ -81,20 +81,26 @@ dev_sioctl_onval(void *arg, unsigned int addr, unsigned int val)
struct dev *d = arg;
struct ctl *c;
- dev_log(d);
- log_puts(": onctl: addr = ");
- log_putu(addr);
- log_puts(", val = ");
- log_putu(val);
- log_puts("\n");
+ if (log_level >= 2) {
+ dev_log(d);
+ log_puts(": onctl: addr = ");
+ log_putu(addr);
+ log_puts(", val = ");
+ log_putu(val);
+ log_puts("\n");
+ }
for (c = ctl_list; c != NULL; c = c->next) {
if (c->scope != CTL_HW || c->u.hw.addr != addr)
continue;
- ctl_log(c);
- log_puts(": new value -> ");
- log_putu(val);
- log_puts("\n");
+
+ if (log_level >= 2) {
+ ctl_log(c);
+ log_puts(": new value -> ");
+ log_putu(val);
+ log_puts("\n");
+ }
+
c->val_mask = ~0U;
c->curval = val;
}