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: <20250413104802.49360-2-thorsten.blum@linux.dev>
Date: Sun, 13 Apr 2025 12:48:03 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Johan Hovold <johan@...nel.org>,
	Alex Elder <elder@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Thorsten Blum <thorsten.blum@...ux.dev>,
	greybus-dev@...ts.linaro.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] staging: greybus: Reformat code in gb_operation_sync_timeout()

Remove any unnecessary curly braces and combine 'else' and 'if' to an
'else if' to improve the code's readability and reduce indentation.

Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
---
 drivers/greybus/operation.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/greybus/operation.c b/drivers/greybus/operation.c
index 8459e9bc0749..ba26504ccac3 100644
--- a/drivers/greybus/operation.c
+++ b/drivers/greybus/operation.c
@@ -1157,16 +1157,12 @@ int gb_operation_sync_timeout(struct gb_connection *connection, int type,
 		memcpy(operation->request->payload, request, request_size);
 
 	ret = gb_operation_request_send_sync_timeout(operation, timeout);
-	if (ret) {
+	if (ret)
 		dev_err(&connection->hd->dev,
 			"%s: synchronous operation id 0x%04x of type 0x%02x failed: %d\n",
 			connection->name, operation->id, type, ret);
-	} else {
-		if (response_size) {
-			memcpy(response, operation->response->payload,
-			       response_size);
-		}
-	}
+	else if (response_size)
+		memcpy(response, operation->response->payload, response_size);
 
 	gb_operation_put(operation);
 
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ