Skip to content

Commit

Permalink
media: saa7134: avoid a shift overflow
Browse files Browse the repository at this point in the history
[ Upstream commit 15a36aa ]

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>
  • Loading branch information
mchehab authored and gregkh committed Oct 29, 2020
1 parent cb475ba commit 4f6af5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/pci/saa7134/saa7134-tvaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,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;
Expand Down

0 comments on commit 4f6af5a

Please sign in to comment.