x86/mm: use WARN_ONCE
PATCH 1/1 x86/mm: use WARN_ONCE
printk + WARN_ON_ONCE can be just WARN_ONCE.
Signed-off-by Jason Wang <[email protected]>
--- arch/x86/mm/ioremap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/mm/ioremap.c +2 -3
@@ -195,9 +195,8 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size,return NULL ;if (!phys_addr_valid (phys_addr)) { -printk (KERN_WARNING "ioremap: invalid physical address %llx\n" , - (unsigned long long )phys_addr); -WARN_ON_ONCE (1 ); +WARN_ONCE (1 ,"ioremap: invalid physical address %llx\n" , + (unsigned long long )phys_addr);return NULL ; }
Signature · 1 line
2.32.0
Andy Lutomirski
maintainerQuoted 14 lines · Jason Wang
printk +
WARN_ON_ONCEcan be justWARN_ONCE.Signed-off-by Jason Wang <[email protected]>--- arch/x86/mm/ioremap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)arch/x86/mm/ioremap.c +0
-0@@ -195,9 +195,8 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size,return NULL ;
arch/x86/mm/ioremap.c __ioremap_caller(resource_size_t phys_addr, unsigned long size, · line 202
Quoted 10 lines
arch/x86/mm/ioremap.c +2
-3if (!phys_addr_valid (phys_addr)) { -printk (KERN_WARNING "ioremap: invalid physical address %llx\n" , - (unsigned long long )phys_addr); -WARN_ON_ONCE (1 ); +WARN_ONCE (1 ,"ioremap: invalid physical address %llx\n" , + (unsigned long long )phys_addr);return NULL ; }
This isn't a no-op change. Before, it would KERN_WARNING once per event and dump a trace once. Now it will only print anything at all once.