linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: remove redundant zero check on count
@ 2019-02-04 19:03 Colin King
  2019-02-18 10:48 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-02-04 19:03 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, linux-bluetooth
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable count is never zero inside the loop so the check if count is
zero is redundant and can be removed. Fix this.

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

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/bluetooth/h4_recv.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/bluetooth/h4_recv.h b/drivers/bluetooth/h4_recv.h
index 307d82166f48..87ccaceadba7 100644
--- a/drivers/bluetooth/h4_recv.h
+++ b/drivers/bluetooth/h4_recv.h
@@ -67,9 +67,6 @@ static inline struct sk_buff *h4_recv_buf(struct hci_dev *hdev,
 	while (count) {
 		int i, len;
 
-		if (!count)
-			break;
-
 		if (!skb) {
 			for (i = 0; i < pkts_count; i++) {
 				if (buffer[0] != (&pkts[i])->type)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: remove redundant zero check on count
  2019-02-04 19:03 [PATCH] Bluetooth: remove redundant zero check on count Colin King
@ 2019-02-18 10:48 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-02-18 10:48 UTC (permalink / raw)
  To: Colin King; +Cc: Johan Hedberg, linux-bluetooth, kernel-janitors, linux-kernel

Hi Colin,

> Variable count is never zero inside the loop so the check if count is
> zero is redundant and can be removed. Fix this.
> 
> Detected by CoverityScan, CID#1466880 ("Logically dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/bluetooth/h4_recv.h | 3 ---
> 1 file changed, 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-18 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 19:03 [PATCH] Bluetooth: remove redundant zero check on count Colin King
2019-02-18 10:48 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).