From a15d8af140528df440617c074136d32be28e4976 Mon Sep 17 00:00:00 2001 From: Lee Leahy Date: Wed, 15 Mar 2017 14:49:35 -0700 Subject: cpu/x86: Remove braces and else if unnecessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following warnings detected by checkpatch.pl WARNING: braces {} are not necessary for single statement blocks WARNING: braces {} are not necessary for any arm of this statement WARNING: else is not generally useful after a break or return TEST=Build and run on Galileo Gen2 Change-Id: I2d6b22c66d52f5f2d24b15270ad4b52894adebc2 Signed-off-by: Lee Leahy Reviewed-on: https://review.coreboot.org/18842 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Martin Roth --- src/cpu/x86/pae/pgtbl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/cpu/x86/pae') diff --git a/src/cpu/x86/pae/pgtbl.c b/src/cpu/x86/pae/pgtbl.c index 303b53fc78..c2fa83d935 100644 --- a/src/cpu/x86/pae/pgtbl.c +++ b/src/cpu/x86/pae/pgtbl.c @@ -72,9 +72,8 @@ void *map_2M_page(unsigned long page) void *result; int i; index = cpu_index(); - if (index >= CONFIG_MAX_CPUS) { + if (index >= CONFIG_MAX_CPUS) return MAPPING_ERROR; - } window = page >> 10; if (window != mapped_window[index]) { paging_off(); @@ -102,10 +101,9 @@ void *map_2M_page(unsigned long page) } mapped_window[index] = window; } - if (window == 0) { + if (window == 0) result = (void *)(page << 21); - } else { + else result = (void *)(0x80000000 | ((page & 0x3ff) << 21)); - } return result; } -- cgit v1.2.3