Skip to contentSkip to conversation

x86:iormap: replace a printk + WARN_ON_ONCE() to a WARN_ONCE() Replace a printk+WARN_ON() by a WARN(); this increases the chance of the string making it into the bugreport.

PATCH New CGEL 1 participant 1 message Aug 20, 2021

Subsystems (2)
lore
Share & tools
lore

CGEL

author
#0 lore raw

PATCH 1/1 x86:iormap: replace a printk + WARN_ON_ONCE() to a WARN_ONCE() Replace a printk+WARN_ON() by a WARN(); this increases the chance of the string making it into the bugreport.

From: jing yangyang <[email protected]>

This issue was detected with the help of Coccinelle.

---
 arch/x86/mm/ioremap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/mm/ioremap.c +1 -2
index 60ade7d..f2ded4a 100644
@@ -195,9 +195,8 @@ static void __ioremap_check_mem(resource_size_t addr, unsigned long size,
 		return NULL;
 
 	if (!phys_addr_valid(phys_addr)) {
-		printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
+		WARN_ONCE(1, "ioremap: invalid physical address %llx\n",
 		       (unsigned long long)phys_addr);
-		WARN_ON_ONCE(1);
 		return NULL;
 	}
 
Signature · 1 line
1.8.3.1