[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/7] hw/scsi/spapr_vscsi: Simplify a bit
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 3/7] hw/scsi/spapr_vscsi: Simplify a bit |
Date: |
Thu, 5 Mar 2020 13:12:49 +0100 |
We already have a 'iu' pointer, use it
(this simplifies the next commit).
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
since v2: fixed typo in description (Greg Kurz)
---
hw/scsi/spapr_vscsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index 7e397ed797..3cb5a38181 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -261,9 +261,9 @@ static int vscsi_send_rsp(VSCSIState *s, vscsi_req *req,
if (status) {
iu->srp.rsp.sol_not = (sol_not & 0x04) >> 2;
if (req->senselen) {
- req->iu.srp.rsp.flags |= SRP_RSP_FLAG_SNSVALID;
- req->iu.srp.rsp.sense_data_len = cpu_to_be32(req->senselen);
- memcpy(req->iu.srp.rsp.data, req->sense, req->senselen);
+ iu->srp.rsp.flags |= SRP_RSP_FLAG_SNSVALID;
+ iu->srp.rsp.sense_data_len = cpu_to_be32(req->senselen);
+ memcpy(iu->srp.rsp.data, req->sense, req->senselen);
total_len += req->senselen;
}
} else {
--
2.21.1
- [PATCH v3 0/7] hw/scsi/spapr_vscsi: Fix time bomb buffer overflow, Philippe Mathieu-Daudé, 2020/03/05
- [PATCH v3 1/7] hw/scsi/viosrp: Add missing 'hw/scsi/srp.h' include, Philippe Mathieu-Daudé, 2020/03/05
- [PATCH v3 2/7] hw/scsi/spapr_vscsi: Use SRP_MAX_IU_LEN instead of sizeof flexible array, Philippe Mathieu-Daudé, 2020/03/05
- [PATCH v3 3/7] hw/scsi/spapr_vscsi: Simplify a bit,
Philippe Mathieu-Daudé <=
- [PATCH v3 5/7] hw/scsi/spapr_vscsi: Do not mix SRP IU size with DMA buffer size, Philippe Mathieu-Daudé, 2020/03/05
- [PATCH v3 6/7] hw/scsi/spapr_vscsi: Prevent buffer overflow, Philippe Mathieu-Daudé, 2020/03/05
- [PATCH v3 4/7] hw/scsi/spapr_vscsi: Introduce req_iu() helper, Philippe Mathieu-Daudé, 2020/03/05
- [PATCH v3 7/7] hw/scsi/spapr_vscsi: Convert debug fprintf() to trace event, Philippe Mathieu-Daudé, 2020/03/05
- Re: [PATCH v3 0/7] hw/scsi/spapr_vscsi: Fix time bomb buffer overflow, no-reply, 2020/03/05
- Re: [PATCH v3 0/7] hw/scsi/spapr_vscsi: Fix time bomb buffer overflow, no-reply, 2020/03/05
- Re: [PATCH v3 0/7] hw/scsi/spapr_vscsi: Fix time bomb buffer overflow, Paolo Bonzini, 2020/03/05
- Re: [PATCH v3 0/7] hw/scsi/spapr_vscsi: Fix time bomb buffer overflow, David Gibson, 2020/03/05