]> www.infradead.org Git - nvme.git/commitdiff
block: use page_to_phys in bvec_phys
authorChristoph Hellwig <hch@lst.de>
Mon, 6 Jan 2025 08:14:37 +0000 (09:14 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 Jan 2025 14:36:39 +0000 (07:36 -0700)
Use page_to_phys instead of open coding it now that it is available in an
architecture independent way.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250106081437.798213-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/bvec.h

index f41c7f0ef91ed53fefec87a1274ef205576ba5ad..ba8f52d48b944535a9717864de46f35aa3879d06 100644 (file)
@@ -286,12 +286,7 @@ static inline void *bvec_virt(struct bio_vec *bvec)
  */
 static inline phys_addr_t bvec_phys(const struct bio_vec *bvec)
 {
-       /*
-        * Note this open codes page_to_phys because page_to_phys is defined in
-        * <asm/io.h>, which we don't want to pull in here.  If it ever moves to
-        * a sensible place we should start using it.
-        */
-       return PFN_PHYS(page_to_pfn(bvec->bv_page)) + bvec->bv_offset;
+       return page_to_phys(bvec->bv_page) + bvec->bv_offset;
 }
 
 #endif /* __LINUX_BVEC_H */