[PATCH 8/9] nvme-pci: replace NVME_MAX_KB_SZ with NVME_MAX_BYTE
Daniel Gomez
da.gomez at kernel.org
Wed Jun 11 07:00:53 PDT 2025
On 10/06/2025 07.06, Christoph Hellwig wrote:
> Having a define in kiB units is a bit weird. Also update the
> comment now that there is not scatterlist limit.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
> drivers/nvme/host/pci.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Reviewed-by: Daniel Gomez <da.gomez at samsung.com>
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 2d3573293d0c..735f448d8db2 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
...
> @@ -3363,7 +3362,8 @@ static struct nvme_dev *nvme_pci_alloc_dev(struct pci_dev *pdev,
> * over a single page.
> */
> dev->ctrl.max_hw_sectors = min_t(u32,
> - NVME_MAX_KB_SZ << 1, dma_opt_mapping_size(&pdev->dev) >> 9);
> + NVME_MAX_BYTES >> SECTOR_SHIFT,
> + dma_opt_mapping_size(&pdev->dev) >> 9);
We use SECTOR_SHIFT for MAX_BYTES but not for the bytes returned from
dma_opt_mapping_size(). Yes, I know this is not part of the change, but still is
the same line. I think it make sense to convert it too.
More information about the Linux-nvme
mailing list