media: av7110_v4l: avoid a typecast
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 1 Sep 2020 09:46:12 +0000 (11:46 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 3 Sep 2020 09:08:20 +0000 (11:08 +0200)
While smatch reports an issue there:

drivers/media/pci/ttpci/av7110_v4l.c:163 ves1820_set_tv_freq() warn: unsigned 'freq' is never less than zero.
drivers/media/pci/ttpci/av7110_v4l.c:165 ves1820_set_tv_freq() warn: unsigned 'freq' is never less than zero.

The logic is actually fine. Yet, removing the typecast
shuts up smatch and makes the code more readable.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/pci/ttpci/av7110_v4l.c

index cabe006658ddb8d97ab43693e01eac2e3713bf03..6d9c908be7139409c0deda1c5b64d82fc80c9624 100644 (file)
@@ -160,9 +160,9 @@ static int ves1820_set_tv_freq(struct saa7146_dev *dev, u32 freq)
        buf[1] = div & 0xff;
        buf[2] = 0x8e;
 
-       if (freq < (u32) (16 * 168.25))
+       if (freq < 16U * 168.25)
                config = 0xa0;
-       else if (freq < (u32) (16 * 447.25))
+       else if (freq < 16U * 447.25)
                config = 0x90;
        else
                config = 0x30;