ALSA: hda: fix a mask for unsolicited event tags
authorGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Tue, 11 Jun 2019 17:09:07 +0000 (19:09 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 11 Jun 2019 17:20:43 +0000 (19:20 +0200)
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.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_jack.c

index 74b46952fc987441b59f86ba06efce8d1b507ead..60a548513c9db191de26e387a56b8a1961826bdc 100644 (file)
@@ -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)