Skip to content

Commit

Permalink
nvme: Correct the prps per page calculation method
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
  • Loading branch information
wesleywesley authored and lbmeng committed Jun 23, 2021
1 parent b12f623 commit 859b33c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 859b33c

Please sign in to comment.