* [PATCH] mkiss: remove redundant check on len being zero
@ 2017-09-27 21:45 ` Colin King
0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-09-27 21:45 UTC (permalink / raw)
To: David S . Miller, Stephen Hemminger, Johannes Berg, Ralf Baechle, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The check on len is redundant as it is always greater than 1,
so just remove it and make the printk less complex.
Detected by CoverityScan, CID#1226729 ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/hamradio/mkiss.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index aec6c26563cf..54bf8e6e4a09 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -477,7 +477,8 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
cmd = 0;
}
ax->crcauto = (cmd ? 0 : 1);
- printk(KERN_INFO "mkiss: %s: crc mode %s %d\n", ax->dev->name, (len) ? "set to" : "is", cmd);
+ printk(KERN_INFO "mkiss: %s: crc mode set to %d\n",
+ ax->dev->name, cmd);
}
spin_unlock_bh(&ax->buflock);
netif_start_queue(dev);
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] mkiss: remove redundant check on len being zero
@ 2017-09-27 21:45 ` Colin King
0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-09-27 21:45 UTC (permalink / raw)
To: David S . Miller, Stephen Hemminger, Johannes Berg, Ralf Baechle, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The check on len is redundant as it is always greater than 1,
so just remove it and make the printk less complex.
Detected by CoverityScan, CID#1226729 ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/hamradio/mkiss.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index aec6c26563cf..54bf8e6e4a09 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -477,7 +477,8 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
cmd = 0;
}
ax->crcauto = (cmd ? 0 : 1);
- printk(KERN_INFO "mkiss: %s: crc mode %s %d\n", ax->dev->name, (len) ? "set to" : "is", cmd);
+ printk(KERN_INFO "mkiss: %s: crc mode set to %d\n",
+ ax->dev->name, cmd);
}
spin_unlock_bh(&ax->buflock);
netif_start_queue(dev);
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mkiss: remove redundant check on len being zero
2017-09-27 21:45 ` Colin King
@ 2017-09-30 4:44 ` David Miller
-1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-09-30 4:44 UTC (permalink / raw)
To: colin.king
Cc: stephen, johannes.berg, ralf, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Wed, 27 Sep 2017 22:45:13 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> The check on len is redundant as it is always greater than 1,
> so just remove it and make the printk less complex.
>
> Detected by CoverityScan, CID#1226729 ("Logically dead code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mkiss: remove redundant check on len being zero
@ 2017-09-30 4:44 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-09-30 4:44 UTC (permalink / raw)
To: colin.king
Cc: stephen, johannes.berg, ralf, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Wed, 27 Sep 2017 22:45:13 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> The check on len is redundant as it is always greater than 1,
> so just remove it and make the printk less complex.
>
> Detected by CoverityScan, CID#1226729 ("Logically dead code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-30 4:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27 21:45 [PATCH] mkiss: remove redundant check on len being zero Colin King
2017-09-27 21:45 ` Colin King
2017-09-30 4:44 ` David Miller
2017-09-30 4:44 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.