From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Nicholas Piggin" <npiggin@gmail.com>,
"Glenn Miles" <milesg@linux.ibm.com>,
"Caleb Schlossin" <calebs@linux.vnet.ibm.com>,
qemu-ppc@nongnu.org, "Frédéric Barrat" <fbarrat@linux.ibm.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Cédric Le Goater" <clg@kaod.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-9.1 v2 3/4] hw/ssi/pnv_spi: Return early in transfer()
Date: Wed, 7 Aug 2024 22:28:03 +0200 [thread overview]
Message-ID: <20240807202804.56038-4-philmd@linaro.org> (raw)
In-Reply-To: <20240807202804.56038-1-philmd@linaro.org>
Return early to simplify next commit.
No logical change intended.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ssi/pnv_spi.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c
index 13a47f07e7..05e6afc11e 100644
--- a/hw/ssi/pnv_spi.c
+++ b/hw/ssi/pnv_spi.c
@@ -217,6 +217,9 @@ static void transfer(PnvSpi *s, PnvXferBuffer *payload)
PnvXferBuffer *rsp_payload = NULL;
rsp_payload = pnv_spi_xfer_buffer_new();
+ if (!rsp_payload) {
+ return;
+ }
for (int offset = 0; offset < payload->len; offset += s->transfer_len) {
tx = 0;
for (int i = 0; i < s->transfer_len; i++) {
@@ -235,9 +238,7 @@ static void transfer(PnvSpi *s, PnvXferBuffer *payload)
(rx >> (8 * (s->transfer_len - 1) - i * 8)) & 0xFF;
}
}
- if (rsp_payload != NULL) {
- spi_response(s, s->N1_bits, rsp_payload);
- }
+ spi_response(s, s->N1_bits, rsp_payload);
}
static inline uint8_t get_seq_index(PnvSpi *s)
--
2.45.2
next prev parent reply other threads:[~2024-08-07 20:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 20:28 [PATCH-for-9.1 v2 0/4] hw/ssi/pnv_spi: Fixes Coverity CID 1558831 Philippe Mathieu-Daudé
2024-08-07 20:28 ` [PATCH-for-9.1 v2 1/4] MAINTAINERS: Cover PowerPC SPI model in PowerNV section Philippe Mathieu-Daudé
2024-08-07 20:28 ` [PATCH-for-9.1 v2 2/4] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new() Philippe Mathieu-Daudé
2024-08-07 23:44 ` Richard Henderson
2024-08-07 20:28 ` Philippe Mathieu-Daudé [this message]
2024-08-07 23:42 ` [PATCH-for-9.1 v2 3/4] hw/ssi/pnv_spi: Return early in transfer() Richard Henderson
2024-08-07 20:28 ` [PATCH-for-9.1 v2 4/4] hw/ssi/pnv_spi: Fixes Coverity CID 1558831 Philippe Mathieu-Daudé
2024-08-07 20:28 ` Philippe Mathieu-Daudé
2024-08-07 23:45 ` Richard Henderson
2024-09-12 16:55 ` [PATCH-for-9.1 v2 0/4] " Cédric Le Goater
2024-09-13 13:24 ` Chalapathi V
2024-09-13 13:37 ` Cédric Le Goater
2024-09-16 10:04 ` Chalapathi V
2024-11-04 5:51 ` Nicholas Piggin
2024-11-04 11:21 ` Philippe Mathieu-Daudé
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=20240807202804.56038-4-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alistair@alistair23.me \
--cc=calebs@linux.vnet.ibm.com \
--cc=clg@kaod.org \
--cc=fbarrat@linux.ibm.com \
--cc=milesg@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).