summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-02 08:37:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-30 10:38:28 +0100
commit3a285c8251dbffac3ae62595c19a51d32921cf9a (patch)
treeb83277383e05364123f0a47b5d5af16483db539e
parentac91e46ccec41c96b274952ba34be1cf98777b95 (diff)
downloadlinux-stable-3a285c8251dbffac3ae62595c19a51d32921cf9a.tar.gz
linux-stable-3a285c8251dbffac3ae62595c19a51d32921cf9a.tar.bz2
linux-stable-3a285c8251dbffac3ae62595c19a51d32921cf9a.zip
media: saa7134: avoid a shift overflow
[ Upstream commit 15a36aae1ec1c1f17149b6113b92631791830740 ] As reported by smatch: drivers/media/pci/saa7134//saa7134-tvaudio.c:686 saa_dsp_writel() warn: should 'reg << 2' be a 64 bit type? On a 64-bits Kernel, the shift might be bigger than 32 bits. In real, this should never happen, but let's shut up the warning. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/media/pci/saa7134/saa7134-tvaudio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-tvaudio.c b/drivers/media/pci/saa7134/saa7134-tvaudio.c
index 68d400e1e240..8c3da6f7a60f 100644
--- a/drivers/media/pci/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/pci/saa7134/saa7134-tvaudio.c
@@ -693,7 +693,8 @@ int saa_dsp_writel(struct saa7134_dev *dev, int reg, u32 value)
{
int err;
- audio_dbg(2, "dsp write reg 0x%x = 0x%06x\n", reg << 2, value);
+ audio_dbg(2, "dsp write reg 0x%x = 0x%06x\n",
+ (reg << 2) & 0xffffffff, value);
err = saa_dsp_wait_bit(dev,SAA7135_DSP_RWSTATE_WRR);
if (err < 0)
return err;