diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2017-01-03 06:42:12 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2017-01-03 06:42:12 +0000 |
commit | d4a4219c9de2bd4400089d8ae229cb9faba3ee5e (patch) | |
tree | 4dcc5e0e17f6fad56aa8ab8f7ab0d48edace3a47 /sys/dev | |
parent | ff6d6996cbb4afdd583f62f3f55c30e63b367562 (diff) |
If gain is above MAX, no need to check whether it's below MIN.
From Michael W. Bombardieri. Thanks.
Diffstat (limited to 'sys/dev')
-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", |