[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160226010513.GA187047@athens>
Date: Fri, 26 Feb 2016 09:05:13 +0800
From: kbuild test robot <lkp@...el.com>
To: Marty McFadden <mcfadden8@...l.gov>
Cc: kbuild-all@...org, ak@...ux.intel.com,
andriy.shevchenko@...ux.intel.com, bp@...en8.de, bp@...e.de,
brgerst@...il.com, dan.j.williams@...el.com, dyoung@...hat.com,
hpa@...or.com, linux@...izon.com, linux-kernel@...r.kernel.org,
luto@...nel.org, mcfadden8@...l.gov, mingo@...hat.com,
pavel@....cz, tglx@...utronix.de, viro@...iv.linux.org.uk,
x86@...nel.org, yu.c.chen@...el.com
Subject: [PATCH] MSR: fix badzero.cocci warnings
arch/x86/kernel/msr_whitelist.c:200:18-19: WARNING comparing pointer to 0
arch/x86/kernel/msr_whitelist.c:203:27-28: WARNING comparing pointer to 0
Compare pointer-typed values to NULL rather than 0
Semantic patch information:
This makes an effort to choose between !x and x == NULL. !x is used
if it has previously been used with the function used to initialize x.
This relies on type information. More type information can be obtained
using the option -all_includes and the option -I to specify an
include path.
Generated by: scripts/coccinelle/null/badzero.cocci
CC: Marty McFadden <mcfadden8@...l.gov>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---
msr_whitelist.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/x86/kernel/msr_whitelist.c
+++ b/arch/x86/kernel/msr_whitelist.c
@@ -197,10 +197,10 @@ static const struct file_operations fops
static void delete_whitelist(void)
{
- if (whitelist == 0)
+ if (whitelist == NULL)
return;
- if (whitelist->msrdata != 0)
+ if (whitelist->msrdata != NULL)
kfree(whitelist->msrdata);
kfree(whitelist);
Powered by blists - more mailing lists