lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211104062405.2463-1-luo.penghao@zte.com.cn>
Date:   Thu,  4 Nov 2021 06:24:05 +0000
From:   cgel.zte@...il.com
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        x86@...nel.org, "H . Peter Anvin" <hpa@...or.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        linux-kernel@...r.kernel.org, luo penghao <luo.penghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] x86/mtrr: Remove the if statement

From: luo penghao <luo.penghao@....com.cn>

The "if" here is only for assigning the highest_pfn, but the variable
will not be used later. So this if statement should be deleted.

The clang_analyzer complains as follows:

arch/x86/kernel/cpu/mtrr/cleanup.c:950:4 warning:

Value stored to 'highest_pfn' is never read

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: luo penghao <luo.penghao@....com.cn>
---
 arch/x86/kernel/cpu/mtrr/cleanup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index b5f4304..2c896b4 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -946,8 +946,6 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn)
 	if (mtrr_tom2) {
 		range[nr_range].start = (1ULL<<(32 - PAGE_SHIFT));
 		range[nr_range].end = mtrr_tom2 >> PAGE_SHIFT;
-		if (highest_pfn < range[nr_range].end)
-			highest_pfn = range[nr_range].end;
 		nr_range++;
 	}
 	nr_range = x86_get_mtrr_mem_range(range, nr_range, 0, 0);
-- 
2.15.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ