From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756852AbcAJHCo (ORCPT ); Sun, 10 Jan 2016 02:02:44 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:35753 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751691AbcAJHCm (ORCPT ); Sun, 10 Jan 2016 02:02:42 -0500 Subject: Re: [PATCH] tty: fix badzero.cocci warnings To: kbuild test robot References: <201601101447.4wDGaRGV%fengguang.wu@intel.com> <20160110062417.GA74437@cairo> Cc: kbuild-all@01.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org From: Peter Hurley Message-ID: <56920210.4010001@hurleysoftware.com> Date: Sat, 9 Jan 2016 23:02:40 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160110062417.GA74437@cairo> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/09/2016 10:24 PM, kbuild test robot wrote: > 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 Not sure what possessed me to write 'cons_filp != 0'. Not my style, for sure. Thanks. Regards, Peter Hurley > 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); >