s390/diag: use pfn_to_phys() instead of open coding
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 7 Dec 2021 18:19:48 +0000 (19:19 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 10 Dec 2021 15:14:25 +0000 (16:14 +0100)
Use pfn_to_phys() instead of open coding to make it
clear what the code is doing.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/diag.h

index b3a8cb4..bdcd64f 100644 (file)
@@ -47,8 +47,8 @@ static inline void diag10_range(unsigned long start_pfn, unsigned long num_pfn)
 {
        unsigned long start_addr, end_addr;
 
-       start_addr = start_pfn << PAGE_SHIFT;
-       end_addr = (start_pfn + num_pfn - 1) << PAGE_SHIFT;
+       start_addr = pfn_to_phys(start_pfn);
+       end_addr = pfn_to_phys(start_pfn + num_pfn - 1);
 
        diag_stat_inc(DIAG_STAT_X010);
        asm volatile(