提交 82e1b804 编写于 作者: T Takashi Iwai

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: NTakashi Iwai <tiwai@suse.de>
上级 6430aeeb
...@@ -150,8 +150,8 @@ make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, ...@@ -150,8 +150,8 @@ make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct,
{ {
u32 val; u32 val;
if ((codec->addr & ~0xf) | (direct & ~1) | (nid & ~0x7f) | if ((codec->addr & ~0xf) || (direct & ~1) || (nid & ~0x7f) ||
(verb & ~0xfff) | (parm & ~0xff)) { (verb & ~0xfff) || (parm & ~0xffff)) {
printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n", printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n",
codec->addr, direct, nid, verb, parm); codec->addr, direct, nid, verb, parm);
return ~0; return ~0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册