[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 41/60] hw/cxl/mbox: Remove dead code
From: |
Michael S. Tsirkin |
Subject: |
[PULL 41/60] hw/cxl/mbox: Remove dead code |
Date: |
Wed, 14 Feb 2024 06:15:24 -0500 |
From: Davidlohr Bueso <dave@stgolabs.net>
Two functions were reported to have dead code, remove the bogus
branches altogether, as well as a misplaced qemu_log call.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240126120132.24248-6-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/cxl/cxl-mailbox-utils.c | 43 +++++++++++++-------------------------
1 file changed, 15 insertions(+), 28 deletions(-)
diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
index 6eff56fb1b..dc42850767 100644
--- a/hw/cxl/cxl-mailbox-utils.c
+++ b/hw/cxl/cxl-mailbox-utils.c
@@ -1001,15 +1001,8 @@ static CXLRetCode cmd_sanitize_overwrite(const struct
cxl_cmd *cmd,
cxl_dev_disable_media(&ct3d->cxl_dstate);
- if (secs > 2) {
- /* sanitize when done */
- return CXL_MBOX_BG_STARTED;
- } else {
- __do_sanitization(ct3d);
- cxl_dev_enable_media(&ct3d->cxl_dstate);
-
- return CXL_MBOX_SUCCESS;
- }
+ /* sanitize when done */
+ return CXL_MBOX_BG_STARTED;
}
static CXLRetCode cmd_get_security_state(const struct cxl_cmd *cmd,
@@ -1387,27 +1380,21 @@ static void bg_timercb(void *opaque)
cci->bg.complete_pct = 100;
cci->bg.ret_code = ret;
- if (ret == CXL_MBOX_SUCCESS) {
- switch (cci->bg.opcode) {
- case 0x4400: /* sanitize */
- {
- CXLType3Dev *ct3d = CXL_TYPE3(cci->d);
+ switch (cci->bg.opcode) {
+ case 0x4400: /* sanitize */
+ {
+ CXLType3Dev *ct3d = CXL_TYPE3(cci->d);
- __do_sanitization(ct3d);
- cxl_dev_enable_media(&ct3d->cxl_dstate);
- }
- break;
- case 0x4304: /* TODO: scan media */
- break;
- default:
- __builtin_unreachable();
- break;
- }
+ __do_sanitization(ct3d);
+ cxl_dev_enable_media(&ct3d->cxl_dstate);
+ }
+ break;
+ case 0x4304: /* TODO: scan media */
+ break;
+ default:
+ __builtin_unreachable();
+ break;
}
-
- qemu_log("Background command %04xh finished: %s\n",
- cci->bg.opcode,
- ret == CXL_MBOX_SUCCESS ? "success" : "aborted");
} else {
/* estimate only */
cci->bg.complete_pct = 100 * now / total_time;
--
MST
- [PULL 29/60] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL, (continued)
- [PULL 29/60] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL, Michael S. Tsirkin, 2024/02/14
- [PULL 30/60] hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL, Michael S. Tsirkin, 2024/02/14
- [PULL 31/60] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions, Michael S. Tsirkin, 2024/02/14
- [PULL 32/60] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Michael S. Tsirkin, 2024/02/14
- [PULL 33/60] vhost-user.rst: Fix vring address description, Michael S. Tsirkin, 2024/02/14
- [PULL 35/60] virtio_iommu: Clear IOMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 36/60] smmu: Clear SMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 34/60] MAINTAINERS: Drop myself as VT-d maintainers, Michael S. Tsirkin, 2024/02/14
- [PULL 40/60] cxl/cdat: Fix header sum value in CDAT checksum, Michael S. Tsirkin, 2024/02/14
- [PULL 39/60] hw/pci-bridge/cxl_upstream: Drop g_malloc() failure handling, Michael S. Tsirkin, 2024/02/14
- [PULL 41/60] hw/cxl/mbox: Remove dead code,
Michael S. Tsirkin <=
- [PULL 42/60] hw/cxl/device: read from register values in mdev_reg_read(), Michael S. Tsirkin, 2024/02/14
- [PULL 46/60] tests/acpi: Allow update of DSDT.cxl, Michael S. Tsirkin, 2024/02/14
- [PULL 47/60] hw/i386: Fix _STA return value for ACPI0017, Michael S. Tsirkin, 2024/02/14
- [PULL 37/60] cxl/cdat: Handle cdat table build errors, Michael S. Tsirkin, 2024/02/14
- [PULL 38/60] hw/mem/cxl_type3: Drop handling of failure of g_malloc0() and g_malloc(), Michael S. Tsirkin, 2024/02/14
- [PULL 43/60] hw/cxl: Pass CXLComponentState to cache_mem_ops, Michael S. Tsirkin, 2024/02/14
- [PULL 44/60] hw/cxl: Pass NULL for a NULL MemoryRegionOps, Michael S. Tsirkin, 2024/02/14
- [PULL 45/60] hw/mem/cxl_type3: Fix potential divide by zero reported by coverity, Michael S. Tsirkin, 2024/02/14
- [PULL 48/60] tests/acpi: Update DSDT.cxl to reflect change _STA return value., Michael S. Tsirkin, 2024/02/14
- [PULL 50/60] hw/cxl: Update link register definitions., Michael S. Tsirkin, 2024/02/14