Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421AbbLMWDp (ORCPT ); Sun, 13 Dec 2015 17:03:45 -0500 Received: from mailfilter.ece.umd.edu ([129.2.90.4]:50248 "EHLO mailfilter.ece.umd.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbbLMWDK (ORCPT ); Sun, 13 Dec 2015 17:03:10 -0500 X-ASG-Debug-ID: 1450044188-04739d15353a61c0001-xx1T2L X-Barracuda-Envelope-From: sgilles@math.umd.edu X-Barracuda-Effective-Source-IP: mail-qk0-f176.google.com[209.85.220.176] X-Barracuda-Apparent-Source-IP: 209.85.220.176 From: "S. Gilles" X-Google-Original-From: "S. Gilles" Date: Sun, 13 Dec 2015 17:02:54 -0500 To: Joe Perches Cc: "S. Gilles" , Andy Whitcroft , linux-kernel@vger.kernel.org Subject: Re: [PATCH] checkpatch: detect leading * in NULL comparison check Message-ID: <20151213220254.GA26291@number16> X-ASG-Orig-Subj: Re: [PATCH] checkpatch: detect leading * in NULL comparison check References: <1450029592-476-1-git-send-email-sgilles@math.umd.edu> <1450039741.20678.7.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1450039741.20678.7.camel@perches.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Barracuda-Connect: mail-qk0-f176.google.com[209.85.220.176] X-Barracuda-Start-Time: 1450044188 X-Barracuda-URL: https://mailfilter.ece.umd.edu:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 903 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=7.0 KILL_LEVEL=1000.0 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.25228 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1116 Lines: 37 On 2015-12-13T12:49:01, Joe Perches wrote: > On Sun, 2015-12-13 at 12:59 -0500, S. Gilles wrote: > > Prevent checkpatch.pl from emitting messages like > > > >   CHECK: Comparison to NULL could be written "!rx_p" > >   #51: FILE: drivers/staging/iio/accel/sca3000_ring.c:51: > >   +       if (*rx_p == NULL) { > > > > by checking for leading * characters in the comparison value. > > > > Signed-off-by: S. Gilles > > --- > > > > I've run this through everything in staging/ as a test, it seems to > > work okay. > > This wouldn't work with > > * foo == NULL; > > but there don't seem to be any in the kernel source. Some other stuff like *(foo) == NULL won't be caught as well, but in such false negative cases, other style conventions would have to be violated anyway. I'm not sure how strong that argument is. -- S. Gilles -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/