lkml.org 
[lkml]   [2017]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86/microcode/AMD: remove redundant null check on mc
Date
From: Colin Ian King <colin.king@canonical.com>

mc is a pointer to the static u8 array amd_ucode_patch and
therefore can never be null, so the check is redundant. Remove it.

Detected by CoverityScan, CID#1372871 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
arch/x86/kernel/cpu/microcode/amd.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 7889ae4..f2afe99 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -352,9 +352,6 @@ void reload_ucode_amd(void)
u32 rev, dummy;

mc = (struct microcode_amd *)amd_ucode_patch;
- if (!mc)
- return;
-
rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);

if (rev < mc->hdr.patch_id) {
--
2.10.2
\
 
 \ /
  Last update: 2017-03-15 18:12    [W:0.323 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site