summaryrefslogtreecommitdiffstats
path: root/sound/firewire
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2021-01-25 23:02:08 +0900
committerTakashi Iwai <tiwai@suse.de>2021-01-26 07:31:13 +0100
commite32da5eb627c9dd60fd245cb5beb3079e96890d1 (patch)
tree11caa8222a0ef85482661f933c804d6080ce1022 /sound/firewire
parentf4514249d6483effbc08984ed908fc741de798f0 (diff)
downloadlinux-e32da5eb627c9dd60fd245cb5beb3079e96890d1.tar.bz2
ALSA: bebob: remove an unnecessary condition in hwdep_read()
Drivers in ALSA firewire stack supports eventing to userspace applications via ALSA hwdep interface. All of the drivers supports stream lock events. Some of them supports their unique events according to specification of target device. ALSA bebob driver supports the stream lock event only. In the case, it's enough to check condition only in loop with process blocking. However, current implementation check it again after breaking the loop. This commit removes the redundant check. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20210125140208.26318-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r--sound/firewire/bebob/bebob_hwdep.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/firewire/bebob/bebob_hwdep.c b/sound/firewire/bebob/bebob_hwdep.c
index 8677e3ec8d14..6f9331655d43 100644
--- a/sound/firewire/bebob/bebob_hwdep.c
+++ b/sound/firewire/bebob/bebob_hwdep.c
@@ -37,11 +37,9 @@ hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
memset(&event, 0, sizeof(event));
count = min_t(long, count, sizeof(event.lock_status));
- if (bebob->dev_lock_changed) {
- event.lock_status.type = SNDRV_FIREWIRE_EVENT_LOCK_STATUS;
- event.lock_status.status = (bebob->dev_lock_count > 0);
- bebob->dev_lock_changed = false;
- }
+ event.lock_status.type = SNDRV_FIREWIRE_EVENT_LOCK_STATUS;
+ event.lock_status.status = (bebob->dev_lock_count > 0);
+ bebob->dev_lock_changed = false;
spin_unlock_irq(&bebob->lock);