summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-05-04 14:59:11 +0100
committerTakashi Iwai <tiwai@suse.de>2016-05-09 17:35:50 +0200
commit875f6fffa2e09b48fa07ecbf2e28dd2425b5ce01 (patch)
tree8e6b082b705f1d528b0ca40fa17450a136a10023 /sound/core
parent1d03f2bd56f3a45123a7572fb536c063068cfb83 (diff)
downloadlinux-875f6fffa2e09b48fa07ecbf2e28dd2425b5ce01.tar.bz2
ALSA: compress: Replace complex if statement with switch
A switch statement looks a bit cleaner than an if statement spread over 3 lines, as such update this to a switch. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/compress_offload.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index f56f4e358b76..9b3334be9df2 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -288,9 +288,12 @@ static ssize_t snd_compr_write(struct file *f, const char __user *buf,
stream = &data->stream;
mutex_lock(&stream->device->lock);
/* write is allowed when stream is running or has been steup */
- if (stream->runtime->state != SNDRV_PCM_STATE_SETUP &&
- stream->runtime->state != SNDRV_PCM_STATE_PREPARED &&
- stream->runtime->state != SNDRV_PCM_STATE_RUNNING) {
+ switch (stream->runtime->state) {
+ case SNDRV_PCM_STATE_SETUP:
+ case SNDRV_PCM_STATE_PREPARED:
+ case SNDRV_PCM_STATE_RUNNING:
+ break;
+ default:
mutex_unlock(&stream->device->lock);
return -EBADFD;
}