Skip to contentSkip to conversation

block: use page_to_phys in bvec_phys

PATCH Applied Christoph Hellwig 2 participants 2 messages Jan 6, 2025 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: use page_to_phys in bvec_phys

Use page_to_phys instead of open coding it now that it is available in an architecture independent way.

---
 include/linux/bvec.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
include/linux/bvec.h +1 -6
index f41c7f0ef91e..ba8f52d48b94 100644
@@ -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 */
Signature · 1 line
2.45.2
maintainer Applied
#1 lore raw
Quoted 4 lines · Christoph Hellwig

Use page_to_phys instead of open coding it now that it is available in an architecture independent way.

Applied, thanks!

[1/1] block: use page_to_phys in bvec_phys

      commit: 2caca8fc7aad9ea9a6ea3ed26ed146b1e5f06fab

Best regards,

Signature · 1 line
Jens Axboe