]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
nvme: Correct the prps per page calculation method
authorWesley Sheng <wesleyshenggit@sina.com>
Tue, 22 Jun 2021 03:34:21 +0000 (11:34 +0800)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 23 Jun 2021 09:21:14 +0000 (17:21 +0800)
Each prp is 8 bytes, calculate the number of prps
per page should just divide page size by 8
there is no need to minus 1

Signed-off-by: Wesley Sheng <wesleyshenggit@sina.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/nvme/nvme.c

index d554ec54cbe0c03457ace2d9f64c5078e00b5a35..dc6c39ba10beca3a49a30d9bbee8e1762494c425 100644 (file)
@@ -81,7 +81,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
        u64 *prp_pool;
        int length = total_len;
        int i, nprps;
-       u32 prps_per_page = (page_size >> 3) - 1;
+       u32 prps_per_page = page_size >> 3;
        u32 num_pages;
 
        length -= (page_size - offset);