aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-17 06:47:34 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-17 06:47:34 -0400
commit82e1b804b03defe46fb69ffd2c8b19e6649bcb0d (patch)
treeb4f896bcb0e1197a021809355af70a6c1da913fe /sound/pci/hda/hda_codec.c
parent6430aeeb30b478d4ef25f988b1fde6f6ae83adb5 (diff)
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 <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c4
1 files changed, 2 insertions, 2 deletions
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,
150{ 150{
151 u32 val; 151 u32 val;
152 152
153 if ((codec->addr & ~0xf) | (direct & ~1) | (nid & ~0x7f) | 153 if ((codec->addr & ~0xf) || (direct & ~1) || (nid & ~0x7f) ||
154 (verb & ~0xfff) | (parm & ~0xff)) { 154 (verb & ~0xfff) || (parm & ~0xffff)) {
155 printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n", 155 printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n",
156 codec->addr, direct, nid, verb, parm); 156 codec->addr, direct, nid, verb, parm);
157 return ~0; 157 return ~0;