Linux-Bluetooth Archive on lore.kernel.org
 help / 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	[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, back to index

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

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox