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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220721024443.112126-1-yang.lee@linux.alibaba.com>
Date:   Thu, 21 Jul 2022 10:44:43 +0800
From:   Yang Li <yang.lee@...ux.alibaba.com>
To:     ap420073@...il.com
Cc:     davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Yang Li <yang.lee@...ux.alibaba.com>,
        Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH -next] amt: Return true/false (not 1/0) from bool function

Return boolean values ("true" or "false") instead of 1 or 0 from bool
functions. This fixes the following warnings from coccicheck:

./drivers/net/amt.c:901:9-10: WARNING: return of 0/1 in function 'amt_queue_event' with return type bool

Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
---
 drivers/net/amt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index febfcf2d92af..2ff53e73f10f 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -898,7 +898,7 @@ static bool amt_queue_event(struct amt_dev *amt, enum amt_event event,
 	spin_lock_bh(&amt->lock);
 	if (amt->nr_events >= AMT_MAX_EVENTS) {
 		spin_unlock_bh(&amt->lock);
-		return 1;
+		return true;
 	}
 
 	index = (amt->event_idx + amt->nr_events) % AMT_MAX_EVENTS;
@@ -909,7 +909,7 @@ static bool amt_queue_event(struct amt_dev *amt, enum amt_event event,
 	queue_work(amt_wq, &amt->event_wq);
 	spin_unlock_bh(&amt->lock);
 
-	return 0;
+	return false;
 }
 
 static void amt_secret_work(struct work_struct *work)
-- 
2.20.1.7.g153144c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ