summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2025-12-17 11:41:23 +0200
committerJens Axboe <axboe@kernel.dk>2026-01-06 05:47:54 -0700
commit073b9bf9af463d32555c5ebaf7e28c3a44c715d0 (patch)
tree0e6da98a93f22950b14405f5c2c162ee3c8ace68 /drivers
parentf8f9c1f4d0c7a64600e2ca312dec824a0bc2f1da (diff)
nvme-pci: Use size_t for length fields to handle larger sizes
This patch changes the length variables from unsigned int to size_t. Using size_t ensures that we can handle larger sizes, as size_t is always equal to or larger than the previously used u32 type. Originally, u32 was used because blk-mq-dma code evolved from scatter-gather implementation, which uses unsigned int to describe length. This change will also allow us to reuse the existing struct phys_vec in places that don't need scatter-gather. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/host/pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 0e4caeab739c..3b528369f545 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -290,14 +290,14 @@ struct nvme_iod {
u8 flags;
u8 nr_descriptors;
- unsigned int total_len;
+ size_t total_len;
struct dma_iova_state dma_state;
void *descriptors[NVME_MAX_NR_DESCRIPTORS];
struct nvme_dma_vec *dma_vecs;
unsigned int nr_dma_vecs;
dma_addr_t meta_dma;
- unsigned int meta_total_len;
+ size_t meta_total_len;
struct dma_iova_state meta_dma_state;
struct nvme_sgl_desc *meta_descriptor;
};