From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756703AbcAJG0G (ORCPT ); Sun, 10 Jan 2016 01:26:06 -0500 Received: from mga04.intel.com ([192.55.52.120]:23850 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753270AbcAJGZb (ORCPT ); Sun, 10 Jan 2016 01:25:31 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,547,1444719600"; d="scan'208";a="26696768" Date: Sun, 10 Jan 2016 14:24:18 +0800 From: kbuild test robot To: Peter Hurley Cc: kbuild-all@01.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, Peter Hurley Subject: [PATCH] tty: fix badzero.cocci warnings Message-ID: <20160110062417.GA74437@cairo> References: <201601101447.4wDGaRGV%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452400870-6005-18-git-send-email-peter@hurleysoftware.com> 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 drivers/tty/tty_io.c:731:36-37: 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: Peter Hurley Signed-off-by: Fengguang Wu --- tty_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -728,7 +728,7 @@ static void __tty_hangup(struct tty_stru while (refs--) tty_kref_put(tty); - tty_ldisc_hangup(tty, cons_filp != 0); + tty_ldisc_hangup(tty, cons_filp != NULL); spin_lock_irq(&tty->ctrl_lock); clear_bit(TTY_THROTTLED, &tty->flags);