[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1471809094.3746.17.camel@perches.com>
Date: Sun, 21 Aug 2016 12:51:34 -0700
From: Joe Perches <joe@...ches.com>
To: SF Markus Elfring <elfring@...rs.sourceforge.net>,
alsa-devel@...a-project.org, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Vinod Koul <vinod.koul@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 2/2] ALSA: compress: Reduce the scope for two variables
in snd_compr_set_params()
On Sun, 2016-08-21 at 21:45 +0200, SF Markus Elfring wrote:
> Reduce the scope for the local variables to an if branch.
[]
> diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
[]
> @@ -545,14 +545,14 @@ static int snd_compress_check_input(struct snd_compr_params *params)
> static int
> snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
> {
> - struct snd_compr_params *params;
> - int retval;
> -
> if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
Likely better not reducing variable scope but changing:
if (stream->runtime->state == SNDRV_PCM_STATE_OPEN)
to
if (stream->runtime->state != SNDRV_PCM_STATE_OPEN)
return -EPERM;
and unindenting the remainder of the code one level instead.
Powered by blists - more mailing lists