]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] pvrusb2: remove redundant check on cnt > 8
authorColin Ian King <colin.king@canonical.com>
Sun, 7 May 2017 18:33:05 +0000 (15:33 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 7 Jun 2017 16:52:41 +0000 (13:52 -0300)
The 2nd check of cnt > 8 is redundant as cnt is already checked
and thresholded to a maximum of 8 a few statements earlier.
Remove this redundant 2nd check.

Detected by CoverityScan, CID#114281 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c

index f727b54a53c6d94a34476e9d22fca1de544b3ca2..20a52b785fffbd7effc8e622aa4dfbbc096d3d7b 100644 (file)
@@ -488,7 +488,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap,
                        if ((ret > 0) || !(msgs[idx].flags & I2C_M_RD)) {
                                if (cnt > 8) cnt = 8;
                                printk(KERN_CONT " [");
-                               for (offs = 0; offs < (cnt>8?8:cnt); offs++) {
+                               for (offs = 0; offs < cnt; offs++) {
                                        if (offs) printk(KERN_CONT " ");
                                        printk(KERN_CONT "%02x",msgs[idx].buf[offs]);
                                }