linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: intel8x0: Fix incorrect codec index usage in mixer for ICH4
@ 2025-06-21 18:52 Alok Tiwari
  2025-06-22  9:28 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Alok Tiwari @ 2025-06-21 18:52 UTC (permalink / raw)
  To: perex, tiwai, phasta, andriy.shevchenko, linux-sound
  Cc: alok.a.tiwari, linux-kernel

code mistakenly used a hardcoded index (codec[1]) instead of
iterating, over the codec array using the loop variable i.
Use codec[i] instead of codec[1] to match the loop iteration.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 sound/pci/intel8x0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 51e7f1f1a48e4..b521cec203336 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2249,7 +2249,7 @@ static int snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
 			tmp |= chip->ac97_sdin[0] << ICH_DI1L_SHIFT;
 			for (i = 1; i < 4; i++) {
 				if (pcm->r[0].codec[i]) {
-					tmp |= chip->ac97_sdin[pcm->r[0].codec[1]->num] << ICH_DI2L_SHIFT;
+					tmp |= chip->ac97_sdin[pcm->r[0].codec[i]->num] << ICH_DI2L_SHIFT;
 					break;
 				}
 			}
-- 
2.46.0


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

* Re: [PATCH] ALSA: intel8x0: Fix incorrect codec index usage in mixer for ICH4
  2025-06-21 18:52 [PATCH] ALSA: intel8x0: Fix incorrect codec index usage in mixer for ICH4 Alok Tiwari
@ 2025-06-22  9:28 ` Takashi Iwai
  2025-06-23  8:02   ` Philipp Stanner
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2025-06-22  9:28 UTC (permalink / raw)
  To: Alok Tiwari
  Cc: perex, tiwai, phasta, andriy.shevchenko, linux-sound,
	linux-kernel

On Sat, 21 Jun 2025 20:52:24 +0200,
Alok Tiwari wrote:
> 
> code mistakenly used a hardcoded index (codec[1]) instead of
> iterating, over the codec array using the loop variable i.
> Use codec[i] instead of codec[1] to match the loop iteration.
> 
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>

Applied now.  Thanks.


Takashi

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

* Re: [PATCH] ALSA: intel8x0: Fix incorrect codec index usage in mixer for ICH4
  2025-06-22  9:28 ` Takashi Iwai
@ 2025-06-23  8:02   ` Philipp Stanner
  2025-06-23  8:52     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Stanner @ 2025-06-23  8:02 UTC (permalink / raw)
  To: Takashi Iwai, Alok Tiwari
  Cc: perex, tiwai, phasta, andriy.shevchenko, linux-sound,
	linux-kernel

On Sun, 2025-06-22 at 11:28 +0200, Takashi Iwai wrote:
> On Sat, 21 Jun 2025 20:52:24 +0200,
> Alok Tiwari wrote:
> > 
> > code mistakenly used a hardcoded index (codec[1]) instead of
> > iterating, over the codec array using the loop variable i.
> > Use codec[i] instead of codec[1] to match the loop iteration.
> > 
> > Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> 
> Applied now.  Thanks.

Shouldn't that have been a bug fix with

Fixes:
and
Cc: stable

?

P.

> 
> 
> Takashi


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

* Re: [PATCH] ALSA: intel8x0: Fix incorrect codec index usage in mixer for ICH4
  2025-06-23  8:02   ` Philipp Stanner
@ 2025-06-23  8:52     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2025-06-23  8:52 UTC (permalink / raw)
  To: phasta, Philipp Stanner
  Cc: Takashi Iwai, Alok Tiwari, perex, tiwai, andriy.shevchenko,
	linux-sound, linux-kernel

On Mon, 23 Jun 2025 10:02:30 +0200,
Philipp Stanner wrote:
> 
> On Sun, 2025-06-22 at 11:28 +0200, Takashi Iwai wrote:
> > On Sat, 21 Jun 2025 20:52:24 +0200,
> > Alok Tiwari wrote:
> > > 
> > > code mistakenly used a hardcoded index (codec[1]) instead of
> > > iterating, over the codec array using the loop variable i.
> > > Use codec[i] instead of codec[1] to match the loop iteration.
> > > 
> > > Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> > 
> > Applied now.  Thanks.
> 
> Shouldn't that have been a bug fix with
> 
> Fixes:
> and
> Cc: stable
> 
> ?

This change likely won't influence on the existing devices, and the
issue has been present from the very beginning of the driver code,
hence no regression.

The stuff in question is about the hardware of over 20 years ago, and
there has been no bug reports about this.  After all, all devices were
with at most two codecs, and this patch is for 3rd and 4th codecs.


thanks,

Takashi

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

end of thread, other threads:[~2025-06-23  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-21 18:52 [PATCH] ALSA: intel8x0: Fix incorrect codec index usage in mixer for ICH4 Alok Tiwari
2025-06-22  9:28 ` Takashi Iwai
2025-06-23  8:02   ` Philipp Stanner
2025-06-23  8:52     ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).