From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH - AAF PCM plugin 3/7] aaf: Implement Playback mode support Date: Thu, 11 Oct 2018 09:31:37 +0200 Message-ID: References: <20181003234547.16839-1-andre.guedes@intel.com> <20181003234547.16839-4-andre.guedes@intel.com> <1539206847.3120.20.camel@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 668DB267737 for ; Thu, 11 Oct 2018 09:31:39 +0200 (CEST) In-Reply-To: <1539206847.3120.20.camel@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: "Guedes, Andre" Cc: "alsa-devel@alsa-project.org" , "Girdwood, Liam R" List-Id: alsa-devel@alsa-project.org On Wed, 10 Oct 2018 23:27:29 +0200, Guedes, Andre wrote: > > On Wed, 2018-10-10 at 12:34 +0200, Takashi Iwai wrote: > > > +static int aaf_set_hw_constraint(snd_pcm_aaf_t *aaf) > > > +{ > > > + int res; > > > + snd_pcm_ioplug_t *io = &aaf->io; > > > + const unsigned int accesses[] = { > > > + SND_PCM_ACCESS_RW_INTERLEAVED, > > > + }; > > > + const unsigned int formats[] = { > > > + SND_PCM_FORMAT_S16_BE, > > > + SND_PCM_FORMAT_S24_3BE, > > > + SND_PCM_FORMAT_S32_BE, > > > + SND_PCM_FORMAT_FLOAT_BE, > > > + }; > > > + const unsigned int rates[] = { > > > + 8000, > > > + 16000, > > > + 24000, > > > + 32000, > > > + 44100, > > > + 48000, > > > + 88200, > > > + 96000, > > > + 176400, > > > + 192000, > > > + }; > > > > Use static arrays for the above. > > It isn't clear to me what is the point in allocating these variables in > the global scope. May I ask what is the benefit in adding the 'static' > modifier to these local variables? Yes. Takashi