Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/early_ioremap: print the starting physical address in __early_ioremap()

The debug WARN() printing occurs after the while loop, so the 'phys_addr'
reflects the last physical address rather than the actual starting
physical address, which is not useful for debugging. To simplify, the
WARN() statement could be moved up before the loop instead of introducing
a new variable to record the original 'phys_addr' value. Additionally,
swap the print order of 'slot_virt[slot]' and 'offset', as this will
enhance output readability.

Link: https://lkml.kernel.org/r/aa2d44c34f44c31b50285b7592ed4fd78d6f59ba.1767965415.git.houwenlong.hwl@antgroup.com
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
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>

authored by

Hou Wenlong and committed by
Andrew Morton
0cc3197b 35520a71

+3 -2
+3 -2
mm/early_ioremap.c
··· 139 139 if (WARN_ON(nrpages > NR_FIX_BTMAPS)) 140 140 return NULL; 141 141 142 + WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n", 143 + __func__, &phys_addr, size, slot, slot_virt[slot], offset); 144 + 142 145 /* 143 146 * Ok, go for it.. 144 147 */ ··· 155 152 --idx; 156 153 --nrpages; 157 154 } 158 - WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n", 159 - __func__, &phys_addr, size, slot, offset, slot_virt[slot]); 160 155 161 156 prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]); 162 157 return prev_map[slot];