Skip to content

Commit 2b75562

Browse files
andy-shevtorvalds
authored andcommitted
include/linux/io-mapping.h-mapping: use PHYS_PFN() macro in io_mapping_map_atomic_wc()
Use PHYS_PFN() macro in io_mapping_map_atomic_wc() instead of open coded variant. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 47a2ebb commit 2b75562

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

include/linux/io-mapping.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct io_mapping {
2828

2929
#ifdef CONFIG_HAVE_ATOMIC_IOMAP
3030

31+
#include <linux/pfn.h>
3132
#include <asm/iomap.h>
3233
/*
3334
* For small address space machines, mapping large objects
@@ -64,12 +65,10 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping,
6465
unsigned long offset)
6566
{
6667
resource_size_t phys_addr;
67-
unsigned long pfn;
6868

6969
BUG_ON(offset >= mapping->size);
7070
phys_addr = mapping->base + offset;
71-
pfn = (unsigned long) (phys_addr >> PAGE_SHIFT);
72-
return iomap_atomic_prot_pfn(pfn, mapping->prot);
71+
return iomap_atomic_prot_pfn(PHYS_PFN(phys_addr), mapping->prot);
7372
}
7473

7574
static inline void

0 commit comments

Comments
 (0)