Skip to contentSkip to conversation

ALSA: HDA: fix a mask

PATCH Applied Guennadi Liakhovetski 2 participants 2 messages Jun 11, 2019 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: HDA: fix a mask

Response tag only occupies 6 bits, not 7. This bug is harmless, since the value has just been shifted to the right by 26 bits, so this is only a cosmetic fix.

---
 sound/pci/hda/hda_jack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_jack.c +1 -1
index 74b4695..60a5485 100644
@@ -563,7 +563,7 @@ static void call_jack_callback(struct hda_codec *codec, unsigned int res,
 void snd_hda_jack_unsol_event(struct hda_codec *codec, unsigned int res)
 {
 	struct hda_jack_tbl *event;
-	int tag = (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x7f;
+	int tag = (res & AC_UNSOL_RES_TAG) >> AC_UNSOL_RES_TAG_SHIFT;
 
 	event = snd_hda_jack_tbl_get_from_tag(codec, tag);
 	if (!event)
Signature · 1 line
1.9.3
Applied
#1 lore raw
Quoted 6 lines · Guennadi Liakhovetski

Response tag only occupies 6 bits, not 7. This bug is harmless, since the value has just been shifted to the right by 26 bits, so this is only a cosmetic fix.

Applied, thanks.

Takashi

Quoted 25 lines
---
 sound/pci/hda/hda_jack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_jack.c +1 -1
index 74b4695..60a5485 100644
@@ -563,7 +563,7 @@ static void call_jack_callback(struct hda_codec *codec, unsigned int res,
 void snd_hda_jack_unsol_event(struct hda_codec *codec, unsigned int res)
 {
 	struct hda_jack_tbl *event;
-	int tag = (res >> AC_UNSOL_RES_TAG_SHIFT) & 0x7f;
+	int tag = (res & AC_UNSOL_RES_TAG) >> AC_UNSOL_RES_TAG_SHIFT;
 
 	event = snd_hda_jack_tbl_get_from_tag(codec, tag);
 	if (!event)
Signature · 6 lines
1.9.3

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel