From: Takashi Iwai Date: Fri, 17 Jul 2009 10:47:34 +0000 (+0200) Subject: ALSA: hda - Fix the previous sanity check in make_codec_cmd() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=82e1b804b03defe46fb69ffd2c8b19e6649bcb0d;p=linux-beck.git ALSA: hda - Fix the previous sanity check in make_codec_cmd() The newly added sanity-check for a codec verb can be better written with logical ORs. Also, the parameter can be more than 8bit. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index d9d326297834..35f0f223f85e 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -150,8 +150,8 @@ make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, { u32 val; - if ((codec->addr & ~0xf) | (direct & ~1) | (nid & ~0x7f) | - (verb & ~0xfff) | (parm & ~0xff)) { + if ((codec->addr & ~0xf) || (direct & ~1) || (nid & ~0x7f) || + (verb & ~0xfff) || (parm & ~0xffff)) { printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n", codec->addr, direct, nid, verb, parm); return ~0;