All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Nicolin Chen <nicoleotsuka@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Timur Tabi <timur@kernel.org>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>
Subject: [PATCH 6/6] ASoC: dmaengine: Use standard pcm_format_to_bits() macro
Date: Wed, 25 Jul 2018 23:17:22 +0200	[thread overview]
Message-ID: <20180725211722.18944-7-tiwai@suse.de> (raw)
In-Reply-To: <20180725211722.18944-1-tiwai@suse.de>

The conversion from PCM format type to bits needs an explicit cast,
and it'll be uglier.  Since we have a standard macro for that, let's
use it instead.

This patch fixes the sparse warning:
  sound/soc/soc-generic-dmaengine-pcm.c:200:63: warning: restricted snd_pcm_format_t degrades to integer

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/soc-generic-dmaengine-pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 61027dd0ef91..bf7aca8523b1 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -197,7 +197,7 @@ static int dmaengine_pcm_set_runtime_hwparams(struct snd_pcm_substream *substrea
 			case 32:
 			case 64:
 				if (addr_widths & (1 << (bits / 8)))
-					hw.formats |= (1LL << i);
+					hw.formats |= pcm_format_to_bits(i);
 				break;
 			default:
 				/* Unsupported types */
-- 
2.18.0

  parent reply	other threads:[~2018-07-25 21:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 21:17 [PATCH 0/6] ASoC: PCM format type conversion fixes Takashi Iwai
2018-07-25 21:17 ` [PATCH 1/6] ALSA: pcm: Add snd_mask_set_format() helper for standard usages Takashi Iwai
2018-07-26 16:11   ` Applied "ALSA: pcm: Add snd_mask_set_format() helper for standard usages" to the asoc tree Mark Brown
2018-07-25 21:17 ` [PATCH 2/6] ASoC: doc: Replace open code with params_set_format() Takashi Iwai
2018-07-26 16:11   ` Applied "ASoC: doc: Replace open code with params_set_format()" to the asoc tree Mark Brown
2018-07-25 21:17 ` [PATCH 3/6] ASoC: intel: Fix snd_pcm_format_t handling Takashi Iwai
2018-07-26 16:11   ` Applied "ASoC: intel: Fix snd_pcm_format_t handling" to the asoc tree Mark Brown
2018-07-25 21:17 ` [PATCH 4/6] ASoC: fsl: Use snd_mask_set_format() Takashi Iwai
2018-07-26 16:11   ` Applied "ASoC: fsl: Use snd_mask_set_format()" to the asoc tree Mark Brown
2018-07-25 21:17 ` [PATCH 5/6] ASoC: pcm186x: Declare PCM format with snd_pcm_format_t Takashi Iwai
2018-07-26 16:11   ` Applied "ASoC: pcm186x: Declare PCM format with snd_pcm_format_t" to the asoc tree Mark Brown
2018-07-25 21:17 ` Takashi Iwai [this message]
2018-07-26 16:11   ` Applied "ASoC: dmaengine: Use standard pcm_format_to_bits() macro" " Mark Brown
2018-07-26 14:46 ` [PATCH 0/6] ASoC: PCM format type conversion fixes Mark Brown
2018-07-26 15:03   ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180725211722.18944-7-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.de \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=timur@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.