Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 875f6fff authored by Charles Keepax's avatar Charles Keepax Committed by Takashi Iwai
Browse files

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 1d03f2bd
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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;
	}