From: Colin Ian King Date: Wed, 25 Apr 2018 10:43:07 +0000 (+0100) Subject: mkiss: remove redundant check for len > 0 X-Git-Tag: v4.19~872^2~381 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f5d295909c9e10a715c4f9f6301ffa701398112;p=platform%2Fkernel%2Flinux-rpi.git mkiss: remove redundant check for len > 0 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index c180b48..13e4c1e 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c @@ -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--;