Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752276AbdDIJg3 (ORCPT ); Sun, 9 Apr 2017 05:36:29 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:34701 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752137AbdDIJgY (ORCPT ); Sun, 9 Apr 2017 05:36:24 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170408172113.GA9352@arushi-HP-Pavilion-Notebook> <20170408201438.GC2679@salvia> From: Liping Zhang Date: Sun, 9 Apr 2017 17:36:22 +0800 Message-ID: Subject: Re: [PATCH] net: netfilter: Replace explicit NULL comparisons To: Jan Engelhardt Cc: Arushi Singhal , Pablo Neira Ayuso , Jozsef Kadlecsik , "David S. Miller" , Netfilter Developer Mailing List , coreteam@netfilter.org, Linux Kernel Network Developers , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1042 Lines: 23 2017-04-09 16:26 GMT+08:00 Jan Engelhardt : > > On Sunday 2017-04-09 05:42, Arushi Singhal wrote: >>On Sun, Apr 9, 2017 at 1:44 AM, Pablo Neira Ayuso wrote: >> On Sat, Apr 08, 2017 at 08:21:56PM +0200, Jan Engelhardt wrote: >> > On Saturday 2017-04-08 19:21, Arushi Singhal wrote: >> > >> > >Replace explicit NULL comparison with ! operator to simplify code. >> > >> > I still wouldn't do this, for the same reason as before. Comparing to >> > NULL explicitly more or less gave an extra guarantee that the other >> > operand was also a pointer. >> >> Arushi, where does it say in the coding style that this is prefered? >> >>This is reported by checkpatch.pl script. > > checkpatch has been controversial at times, like when people took the 80 > character limit way too literally. Changing pointer comparisons looks like > another thing that is better left ignored. Yes, I agree too. Converting the "if (p != NULL)" to "if (p)" like this seems unnecessary.