mkiss: remove redundant check for len > 0
authorColin Ian King <colin.king@canonical.com>
Wed, 25 Apr 2018 10:43:07 +0000 (11:43 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Apr 2018 18:12:06 +0000 (14:12 -0400)
The check for len > 0 is always true and hence is redundant as
this check is already being made to execute the code inside the
while-loop. Hence it is redundant and can be removed.

Cleans up cppcheck warning:
drivers/net/hamradio/mkiss.c:220: (warning) Identical inner 'if'
condition is always true.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hamradio/mkiss.c

index c180b480f8ef519ee3af35d9ecaf36a867c042d3..13e4c1eff3536c6ab1bbc578d2a92d76c6e9027f 100644 (file)
@@ -217,7 +217,7 @@ static int kiss_esc_crc(unsigned char *s, unsigned char *d, unsigned short crc,
                        c = *s++;
                else if (len > 1)
                        c = crc >> 8;
-               else if (len > 0)
+               else
                        c = crc & 0xff;
 
                len--;