lkml.org 
[lkml]   [2019]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86/kaslr: remove useless code in mem_avoid_memmap
Date
MAX_MEMMAP_REGIONS is a macro that equal to 4. "i" is static local
variable that default to 0. The comparison "i >= MAX_MEMMAP_REGIONS"
will always be false.

Signed-off-by: Qian Cai <cai@lca.pw>
---
arch/x86/boot/compressed/kaslr.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 2e53c056ba20..a4a5a88edb94 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -176,9 +176,6 @@ static void mem_avoid_memmap(char *str)
{
static int i;

- if (i >= MAX_MEMMAP_REGIONS)
- return;
-
while (str && (i < MAX_MEMMAP_REGIONS)) {
int rc;
unsigned long long start, size;
--
1.8.3.1
\
 
 \ /
  Last update: 2019-08-22 14:33    [W:0.032 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site