From: Thorsten Blum <thorsten.blum@linux.dev>
To: Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: greybus: Reformat code in gb_operation_sync_timeout()
Date: Sun, 13 Apr 2025 12:48:03 +0200 [thread overview]
Message-ID: <20250413104802.49360-2-thorsten.blum@linux.dev> (raw)
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@linux.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
next reply other threads:[~2025-04-13 10:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-13 10:48 Thorsten Blum [this message]
2025-04-14 7:05 ` [PATCH] staging: greybus: Reformat code in gb_operation_sync_timeout() Johan Hovold
2025-04-14 15:00 ` Thorsten Blum
2025-04-15 6:36 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250413104802.49360-2-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.