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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Sep 2021 17:29:15 -0300
From:   Gaston Gonzalez <gascoar@...il.com>
To:     linux-staging@...ts.linux.dev
Cc:     gregkh@...uxfoundation.org, nsaenz@...nel.org,
        stefan.wahren@...e.com, arnd@...db.de, dan.carpenter@...cle.com,
        ojaswin98@...il.com, amarjargal16@...il.com,
        linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org,
        bcm-kernel-feedback-list@...adcom.com,
        linux-kernel@...r.kernel.org, gascoar@...il.com
Subject: [PATCH 2/3] staging: vchiq: add braces to if block

The rule of not using braces in single statement does not apply if only
one branch of the conditional statement is a single statement. Add
braces to fix this.

While at it, remove extra blank space after a comment inside the if
block.

Reported by checkpatch.pl

Signed-off-by: Gaston Gonzalez <gascoar@...il.com>
---
 .../vc04_services/interface/vchiq_arm/vchiq_connected.c  | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
index f367dbe2bc63..1802fd5e4888 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_connected.c
@@ -34,16 +34,15 @@ void vchiq_add_connected_callback(void (*callback)(void))
 	if (mutex_lock_killable(&g_connected_mutex))
 		return;
 
-	if (g_connected)
+	if (g_connected) {
 		/* We're already connected. Call the callback immediately. */
-
 		callback();
-	else {
-		if (g_num_deferred_callbacks >= MAX_CALLBACKS)
+	} else {
+		if (g_num_deferred_callbacks >= MAX_CALLBACKS) {
 			vchiq_log_error(vchiq_core_log_level,
 				"There already %d callback registered - please increase MAX_CALLBACKS",
 				g_num_deferred_callbacks);
-		else {
+		} else {
 			g_deferred_callback[g_num_deferred_callbacks] =
 				callback;
 			g_num_deferred_callbacks++;
-- 
2.33.0

Powered by blists - more mailing lists