mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
mm/early_ioremap: clean up the use of WARN() for debugging
Using WARN() for debugging is strange when nothing is wrong, so replace WARN(early_ioremap_debug) with pr_warn() + dump_stack(). Link: https://lkml.kernel.org/r/d4470531ce0c03fd80f9a1be7e8d8ae1bc60fcd1.1768220636.git.houwenlong.hwl@antgroup.com Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com> Suggested-by: Mike Rapoport <rppt@kernel.org> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Hou Wenlong <houwenlong.hwl@antgroup.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
0cc3197bdb
commit
5fd8391cb7
1 changed files with 11 additions and 4 deletions
|
|
@ -30,6 +30,14 @@ static int __init early_ioremap_debug_setup(char *str)
|
|||
}
|
||||
early_param("early_ioremap_debug", early_ioremap_debug_setup);
|
||||
|
||||
#define early_ioremap_dbg(fmt, args...) \
|
||||
do { \
|
||||
if (unlikely(early_ioremap_debug)) { \
|
||||
pr_warn(fmt, ##args); \
|
||||
dump_stack(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static int after_paging_init __initdata;
|
||||
|
||||
pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr,
|
||||
|
|
@ -139,8 +147,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
|
|||
if (WARN_ON(nrpages > NR_FIX_BTMAPS))
|
||||
return NULL;
|
||||
|
||||
WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
|
||||
__func__, &phys_addr, size, slot, slot_virt[slot], offset);
|
||||
early_ioremap_dbg("%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
|
||||
__func__, &phys_addr, size, slot, slot_virt[slot], offset);
|
||||
|
||||
/*
|
||||
* Ok, go for it..
|
||||
|
|
@ -185,8 +193,7 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
|
|||
__func__, addr, size, slot, prev_size[slot]))
|
||||
return;
|
||||
|
||||
WARN(early_ioremap_debug, "%s(%p, %08lx) [%d]\n",
|
||||
__func__, addr, size, slot);
|
||||
early_ioremap_dbg("%s(%p, %08lx) [%d]\n", __func__, addr, size, slot);
|
||||
|
||||
virt_addr = (unsigned long)addr;
|
||||
if (WARN_ON(virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue