diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-09-04 17:58:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-10 11:14:58 +0200 |
commit | 51002248a68f2d7e4fcd254c9ae726ab6f40c71e (patch) | |
tree | 39cff0190de4126c810968627ecb0bfce1b11adc /drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | |
parent | 107f3512951993220c8a4032af4719fa3520f37b (diff) | |
download | linux-stable-51002248a68f2d7e4fcd254c9ae726ab6f40c71e.tar.gz linux-stable-51002248a68f2d7e4fcd254c9ae726ab6f40c71e.tar.bz2 linux-stable-51002248a68f2d7e4fcd254c9ae726ab6f40c71e.zip |
staging: bcm2835-audio: Remove redundant substream mask checks
The avail_substreams bit mask is checked for the possible racy
accesses, but this cannot happen in practice; i.e. the assignment and
the check are superfluous.
Let's rip them off.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c')
-rw-r--r-- | drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index bec361aff4fe..942a38942c29 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -523,16 +523,13 @@ int bcm2835_audio_set_ctls(struct bcm2835_chip *chip) /* change ctls for all substreams */ for (i = 0; i < MAX_SUBSTREAMS; i++) { - if (chip->avail_substreams & (1 << i)) { - if (!chip->alsa_stream[i]) { - LOG_DBG(" No ALSA stream available?! %i:%p (%x)\n", i, chip->alsa_stream[i], chip->avail_substreams); - ret = 0; - } else if (bcm2835_audio_set_ctls_chan(chip->alsa_stream[i], chip) != 0) { - LOG_ERR("Couldn't set the controls for stream %d\n", i); - ret = -1; - } else { - LOG_DBG(" Controls set for stream %d\n", i); - } + if (!chip->alsa_stream[i]) + continue; + if (bcm2835_audio_set_ctls_chan(chip->alsa_stream[i], chip) != 0) { + LOG_ERR("Couldn't set the controls for stream %d\n", i); + ret = -1; + } else { + LOG_DBG(" Controls set for stream %d\n", i); } } return ret; |