lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200903131311.442255-2-dwlsalmeida@gmail.com>
Date:   Thu,  3 Sep 2020 10:13:10 -0300
From:   "Daniel W. S. Almeida" <dwlsalmeida@...il.com>
To:     Benoit Parrot <bparrot@...com>
Cc:     "Daniel W. S. Almeida" <dwlsalmeida@...il.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [v2 2/2] media: platform: vpdma.c: fix comparison to bool

From: "Daniel W. S. Almeida" <dwlsalmeida@...il.com>

Fix the following coccinelle report:

drivers/media/platform/ti-vpe/vpdma.c:946:5-26: WARNING:
Comparison to bool

Found using - Coccinelle (http://coccinelle.lip6.fr)

Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@...il.com>
---
 drivers/media/platform/ti-vpe/vpdma.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/ti-vpe/vpdma.c b/drivers/media/platform/ti-vpe/vpdma.c
index 2e5148ae7a0f..5893917ce50d 100644
--- a/drivers/media/platform/ti-vpe/vpdma.c
+++ b/drivers/media/platform/ti-vpe/vpdma.c
@@ -942,14 +942,13 @@ int vpdma_hwlist_alloc(struct vpdma_data *vpdma, void *priv)
 	unsigned long flags;
 
 	spin_lock_irqsave(&vpdma->lock, flags);
-	for (i = 0; i < VPDMA_MAX_NUM_LIST &&
-	    vpdma->hwlist_used[i] == true; i++)
-		;
-
-	if (i < VPDMA_MAX_NUM_LIST) {
+	for (i = 0; i < VPDMA_MAX_NUM_LIST; i++) {
+		if (vpdma->hwlist_used[i])
+			continue;
 		list_num = i;
 		vpdma->hwlist_used[i] = true;
 		vpdma->hwlist_priv[i] = priv;
+		break;
 	}
 	spin_unlock_irqrestore(&vpdma->lock, flags);
 
-- 
2.28.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ