diff options
author | 2017-01-03 06:42:11 +0000 | |
---|---|---|
committer | 2017-01-03 06:42:11 +0000 | |
commit | 90871c1f8fe78c0ab080653f192fbfdd0b8553d3 (patch) | |
tree | c8867078d6a4ff64d75337c0f512de41022ef6cd | |
parent | No need to include sys/malloc.h. From Michael W. Bombardieri. Thanks. (diff) | |
download | wireguard-openbsd-90871c1f8fe78c0ab080653f192fbfdd0b8553d3.tar.xz wireguard-openbsd-90871c1f8fe78c0ab080653f192fbfdd0b8553d3.zip |
If gain is above MAX, no need to check whether it's below MIN.
From Michael W. Bombardieri. Thanks.
-rw-r--r-- | sys/dev/audio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 35f0439fd1d..9cdc374e435 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.159 2016/12/20 15:59:07 ratchov Exp $ */ +/* $OpenBSD: audio.c,v 1.160 2017/01/03 06:42:11 ratchov Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org> * @@ -1925,7 +1925,7 @@ wskbd_mixer_update(struct audio_softc *sc, struct wskbd_vol *vol) gain = ctrl.un.value.level[i] + vol->step * val_pending; if (gain > AUDIO_MAX_GAIN) gain = AUDIO_MAX_GAIN; - if (gain < AUDIO_MIN_GAIN) + else if (gain < AUDIO_MIN_GAIN) gain = AUDIO_MIN_GAIN; ctrl.un.value.level[i] = gain; DPRINTFN(1, "%s: wskbd level %d set to %d\n", |