Messages in this thread Patch in this message |  | | From | Julia Lawall <> | Subject | [PATCH 3/8] arch/x86/kernel/cpu/mtrr/cleanup.c: drop if around WARN_ON | Date | Sat, 3 Nov 2012 21:30:20 +0100 |
| |
From: Julia Lawall <Julia.Lawall@lip6.fr>
Just use WARN_ON rather than an if containing only WARN_ON(1).
A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
--- arch/x86/kernel/cpu/mtrr/cleanup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c index 35ffda5..dd833bf 100644 --- a/arch/x86/kernel/cpu/mtrr/cleanup.c +++ b/arch/x86/kernel/cpu/mtrr/cleanup.c @@ -967,8 +967,7 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn) if (total_trim_size) { pr_warning("WARNING: BIOS bug: CPU MTRRs don't cover all of memory, losing %lluMB of RAM.\n", total_trim_size >> 20); - if (!changed_by_mtrr_cleanup) - WARN_ON(1); + WARN_ON(!changed_by_mtrr_cleanup); pr_info("update e820 for mtrr\n"); update_e820();
|  |