From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932606AbcBZBGo (ORCPT ); Thu, 25 Feb 2016 20:06:44 -0500 Received: from mga02.intel.com ([134.134.136.20]:65423 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932240AbcBZBGn (ORCPT ); Thu, 25 Feb 2016 20:06:43 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="753456775" Date: Fri, 26 Feb 2016 09:05:13 +0800 From: kbuild test robot To: Marty McFadden Cc: kbuild-all@01.org, ak@linux.intel.com, andriy.shevchenko@linux.intel.com, bp@alien8.de, bp@suse.de, brgerst@gmail.com, dan.j.williams@intel.com, dyoung@redhat.com, hpa@zytor.com, linux@horizon.com, linux-kernel@vger.kernel.org, luto@kernel.org, mcfadden8@llnl.gov, mingo@redhat.com, pavel@ucw.cz, tglx@linutronix.de, viro@zeniv.linux.org.uk, x86@kernel.org, yu.c.chen@intel.com Subject: [PATCH] MSR: fix badzero.cocci warnings Message-ID: <20160226010513.GA187047@athens> References: <201602260933.VtBFir59%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456444979-224547-4-git-send-email-mcfadden8@llnl.gov> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Fengguang Wu --- 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);