]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: make INVALID_PHYS_ADDR a generic macro
authorAnshuman Khandual <anshuman.khandual@arm.com>
Tue, 21 Oct 2025 02:56:38 +0000 (03:56 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Nov 2025 01:28:26 +0000 (17:28 -0800)
INVALID_PHYS_ADDR has very similar definitions across the code base.
Hence just move that inside header <liux/mm.h> for more generic usage.
Also drop the now redundant ones which are no longer required.

Link: https://lkml.kernel.org/r/20251021025638.2420216-1-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> [s390]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/arm64/mm/mmu.c
arch/s390/boot/vmem.c
drivers/vdpa/vdpa_user/iova_domain.h
include/linux/mm.h
kernel/dma/swiotlb.c

index b8d37eb037fcca7904682240d49cc7032afc342e..94e29e3574ffea270ea12c8b31889eb7732e09cb 100644 (file)
@@ -470,8 +470,6 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
        mutex_unlock(&fixmap_lock);
 }
 
-#define INVALID_PHYS_ADDR      (-1ULL)
-
 static phys_addr_t __pgd_pgtable_alloc(struct mm_struct *mm, gfp_t gfp,
                                       enum pgtable_type pgtable_type)
 {
index cea3de4dce8c325308774a3a9f01fac7f3ae85f5..fbe64ffdfb96b2c18cd9886af933be310babac5b 100644 (file)
@@ -16,7 +16,6 @@
 #include "decompressor.h"
 #include "boot.h"
 
-#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
 struct ctlreg __bootdata_preserved(s390_invalid_asce);
 
 #ifdef CONFIG_PROC_FS
index 775cad5238f3aa54716a9e34faa4a1ff1bf18a64..a923971a64f5dded31acffccbd8b3f529515e75a 100644 (file)
@@ -17,8 +17,6 @@
 
 #define IOVA_START_PFN 1
 
-#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
-
 #define BOUNCE_MAP_SHIFT       12
 #define BOUNCE_MAP_SIZE        (1 << BOUNCE_MAP_SHIFT)
 #define BOUNCE_MAP_MASK        (~(BOUNCE_MAP_SIZE - 1))
index a6fd9f5aaf30cc4f100dc019efec73f5dffcce13..7bcd9e6fbc3cb7441586700e58127893f5e94f11 100644 (file)
@@ -105,6 +105,8 @@ extern int mmap_rnd_compat_bits __read_mostly;
 # endif
 #endif
 
+#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
+
 #include <asm/page.h>
 #include <asm/processor.h>
 
index 0d37da3d95b65044e34e0f1ad3a0a226960003b0..a547c7693135b67a75b0fdbf8576e08401f8c27e 100644 (file)
@@ -61,8 +61,6 @@
  */
 #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
 
-#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
-
 /**
  * struct io_tlb_slot - IO TLB slot descriptor
  * @orig_addr: The original address corresponding to a mapped entry.