All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/hdmi: Limit the maximal count of PCM devices to 8
@ 2022-09-23  8:22 Jaroslav Kysela
  2022-09-26  6:23 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Jaroslav Kysela @ 2022-09-23  8:22 UTC (permalink / raw)
  To: ALSA development; +Cc: Takashi Iwai

The current hardware has up to 4 converters. Save little space.
The limit 8 is enough even for a more improved hardware.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
 sound/pci/hda/patch_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index ac520c62ee70..d90c9286ac6d 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -151,7 +151,7 @@ struct hdmi_spec {
 	 */
 	int dev_num;
 	struct snd_array pins; /* struct hdmi_spec_per_pin */
-	struct hdmi_pcm pcm_rec[16];
+	struct hdmi_pcm pcm_rec[8];
 	struct mutex pcm_lock;
 	struct mutex bind_lock; /* for audio component binding */
 	/* pcm_bitmap means which pcms have been assigned to pins*/
@@ -2288,8 +2288,8 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
 		pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK];
 		pstr->substreams = 1;
 		pstr->ops = generic_ops;
-		/* pcm number is less than 16 */
-		if (spec->pcm_used >= 16)
+		/* pcm number is less than pcm_rec array size */
+		if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec))
 			break;
 		/* other pstr fields are set in open */
 	}
-- 
2.35.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-26  6:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-23  8:22 [PATCH] ALSA: hda/hdmi: Limit the maximal count of PCM devices to 8 Jaroslav Kysela
2022-09-26  6:23 ` Takashi Iwai

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.