s390/cio,idal: remove superfluous virt_to_phys() conversion
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Mar 2024 12:28:13 +0000 (13:28 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 13 Mar 2024 08:23:47 +0000 (09:23 +0100)
Only the last 12 bits of virtual / physical addresses are used when masking
with IDA_BLOCK_SIZE - 1. Given that the bits are the same regardless of
virtual or physical address, remove the virtual to physical address
conversion.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/idals.h

index 4621097775476018ded41e27b32df64189edc1db..1ceefc9f6fbeb3af1386f62b8fb34727f71ad392 100644 (file)
@@ -41,7 +41,7 @@ static inline unsigned int idal_nr_words(void *vaddr, unsigned int length)
 {
        unsigned int cidaw;
 
-       cidaw = __pa(vaddr) & (IDA_BLOCK_SIZE - 1);
+       cidaw = (unsigned long)vaddr & (IDA_BLOCK_SIZE - 1);
        cidaw += length + IDA_BLOCK_SIZE - 1;
        cidaw >>= IDA_SIZE_SHIFT;
        return cidaw;
@@ -54,7 +54,7 @@ static inline unsigned int idal_2k_nr_words(void *vaddr, unsigned int length)
 {
        unsigned int cidaw;
 
-       cidaw = __pa(vaddr) & (IDA_2K_BLOCK_SIZE - 1);
+       cidaw = (unsigned long)vaddr & (IDA_2K_BLOCK_SIZE - 1);
        cidaw += length + IDA_2K_BLOCK_SIZE - 1;
        cidaw >>= IDA_2K_SIZE_SHIFT;
        return cidaw;