]> git.baikalelectronics.ru Git - kernel.git/commit
media: em28xx: calculate left volume level correctly
authorColin Ian King <colin.king@canonical.com>
Tue, 22 Aug 2017 14:21:20 +0000 (10:21 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 26 Aug 2017 18:31:49 +0000 (14:31 -0400)
commite5f36bdb74e77eeff7e3a5a7657c063fb61317cf
treeacb1a75ea438bc18f8bc924798b9722c1e1333ca
parent4f0200074afd787e99ac537c89bb89b0dadda58b
media: em28xx: calculate left volume level correctly

The calculation of the left volume looks suspect, the value of
0x1f - ((val << 8) & 0x1f) is always 0x1f. The debug prior to the
assignment of value[1] prints the left volume setting using the
calculation 0x1f - (val >> 8) & 0x1f which looks correct to me.
Fix the left volume by using the correct expression as used in
the debug.

Detected by CoverityScan, CID#146140 ("Wrong operator used")

Fixes: 9e2162eec3ca ("[media] em28xx-alsa: add mixer support for AC97 volume controls")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/em28xx/em28xx-audio.c