[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack alloc
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation |
Date: |
Wed, 5 May 2021 23:10:31 +0200 |
The compiler isn't clever enough to figure 'SEG_CHUNK_SIZE' is
a constant! Help it by using a definitions instead.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/block/nvme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 5fe082ec34c..2f6d4925826 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -812,7 +812,7 @@ static uint16_t nvme_map_sgl(NvmeCtrl *n, NvmeSg *sg,
NvmeSglDescriptor sgl,
* descriptors and segment chain) than the command transfer size, so it is
* not bounded by MDTS.
*/
- const int SEG_CHUNK_SIZE = 256;
+#define SEG_CHUNK_SIZE 256
NvmeSglDescriptor segment[SEG_CHUNK_SIZE], *sgld, *last_sgld;
uint64_t nsgld;
--
2.26.3
- Re: [PATCH 04/23] chardev/baum: Avoid dynamic stack allocation, (continued)
[PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation,
Philippe Mathieu-Daudé <=
- Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Keith Busch, 2021/05/05
- Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Philippe Mathieu-Daudé, 2021/05/05
- Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Eric Blake, 2021/05/05
- Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Warner Losh, 2021/05/05
- Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Keith Busch, 2021/05/05
- Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Philippe Mathieu-Daudé, 2021/05/06
- Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Richard Henderson, 2021/05/07
Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Klaus Jensen, 2021/05/06
Re: [PATCH 07/23] hw/block/nvme: Use definition to avoid dynamic stack allocation, Richard Henderson, 2021/05/07
[PATCH 08/23] hw/block/nvme: Avoid dynamic stack allocation, Philippe Mathieu-Daudé, 2021/05/05