All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 01/10] ALSA: hda: Fix implicit PCM format type conversion
Date: Wed, 25 Jul 2018 23:19:36 +0200	[thread overview]
Message-ID: <20180725211945.19222-2-tiwai@suse.de> (raw)
In-Reply-To: <20180725211945.19222-1-tiwai@suse.de>

The PCM format type is defined with __bitwise, hence it can't be
passed as integer but needs an explicit cast.  In this patch, instead
of the messy cast flood, define the format argument of
snd_hdac_calc_stream_format() to be the proper snd_pcm_format_t type.

This fixes sparse warnings like:
  sound/hda/hdac_device.c:760:38: warning: incorrect type in argument 1 (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 include/sound/hdaudio.h | 3 ++-
 sound/hda/hdac_device.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index 8305e7971035..6f1e1f3b3063 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -11,6 +11,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/timecounter.h>
 #include <sound/core.h>
+#include <sound/pcm.h>
 #include <sound/memalloc.h>
 #include <sound/hda_verbs.h>
 #include <drm/i915_component.h>
@@ -133,7 +134,7 @@ int snd_hdac_get_sub_nodes(struct hdac_device *codec, hda_nid_t nid,
 			   hda_nid_t *start_id);
 unsigned int snd_hdac_calc_stream_format(unsigned int rate,
 					 unsigned int channels,
-					 unsigned int format,
+					 snd_pcm_format_t format,
 					 unsigned int maxbps,
 					 unsigned short spdif_ctls);
 int snd_hdac_query_supported_pcm(struct hdac_device *codec, hda_nid_t nid,
diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
index 7ba100bb1c3f..dbf02a3a8d2f 100644
--- a/sound/hda/hdac_device.c
+++ b/sound/hda/hdac_device.c
@@ -738,7 +738,7 @@ static struct hda_rate_tbl rate_bits[] = {
  */
 unsigned int snd_hdac_calc_stream_format(unsigned int rate,
 					 unsigned int channels,
-					 unsigned int format,
+					 snd_pcm_format_t format,
 					 unsigned int maxbps,
 					 unsigned short spdif_ctls)
 {
-- 
2.18.0

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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 21:19 [PATCH 00/10] ALSA: yet more PCM format type conversion fixes Takashi Iwai
2018-07-25 21:19 ` Takashi Iwai [this message]
2018-07-25 21:19 ` [PATCH 02/10] ALSA: riptide: Fix PCM format type conversion Takashi Iwai
2018-07-25 21:19 ` [PATCH 03/10] ALSA: pcm: Fix sparse warning wrt PCM format type Takashi Iwai
2018-07-25 21:19 ` [PATCH 04/10] ALSA: ad1816a: " Takashi Iwai
2018-07-25 21:19 ` [PATCH 05/10] ALSA: au88x0: " Takashi Iwai
2018-07-25 21:19 ` [PATCH 06/10] ALSA: asihpi: Fix PCM format notations Takashi Iwai
2018-07-25 21:19 ` [PATCH 07/10] ALSA: wss: Fix sparse warning wrt PCM format type Takashi Iwai
2018-07-25 21:19 ` [PATCH 08/10] ALSA: sb: Fix PCM format bit calculation Takashi Iwai
2018-07-25 21:19 ` [PATCH 09/10] ALSA: sb: Fix sparse warning wrt PCM format type Takashi Iwai
2018-07-25 21:19 ` [PATCH 10/10] ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits 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=20180725211945.19222-2-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.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.