From 6551a2ffb7ba52581ea2211351c4dcbbc0269c12 Mon Sep 17 00:00:00 2001 From: ratchov Date: Mon, 22 Apr 2024 10:43:55 +0000 Subject: [PATCH] sndiod: Hide forgotten debug printfs --- usr.bin/sndiod/dev_sioctl.c | 28 +++++++++++++++++----------- 1 file 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 * @@ -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; } -- 2.20.1