From: Takashi Iwai Subject: Re: [PATCH] ALSA: Add params_width() helpers Date: Tue, 24 Dec 2013 15:04:16 +0100 Message-ID: References: <1387887868-22084-1-git-send-email-broonie@kernel.org> 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 mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 80FCD261589 for ; Tue, 24 Dec 2013 15:04:17 +0100 (CET) In-Reply-To: <1387887868-22084-1-git-send-email-broonie@kernel.org> 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: Mark Brown Cc: alsa-devel@alsa-project.org, Mark Brown List-Id: alsa-devel@alsa-project.org At Tue, 24 Dec 2013 12:24:28 +0000, Mark Brown wrote: > > From: Mark Brown > > Add helpers for obtaining the width of a format directly from params > since this is expected to become a common operation in ASoC. > > Signed-off-by: Mark Brown Looks good. Since you seem to have already codes using these helpers, feel free to take it via your tree with my ack, then I'll pull yours later. Reviewed-by: Takashi Iwai thanks, Takashi > --- > include/sound/pcm_params.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h > index 37ae12e..6b1c78f 100644 > --- a/include/sound/pcm_params.h > +++ b/include/sound/pcm_params.h > @@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p) > params_channels(p)) / 8; > } > > +static inline int > +params_width(const struct snd_pcm_hw_params *p) > +{ > + return snd_pcm_format_width(params_format(p)); > +} > + > +static inline int > +params_physical_width(const struct snd_pcm_hw_params *p) > +{ > + return snd_pcm_format_physical_width(params_format(p)); > +} > + > #endif /* __SOUND_PCM_PARAMS_H */ > -- > 1.8.5.2 >