Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030180AbbHGPhv (ORCPT ); Fri, 7 Aug 2015 11:37:51 -0400 Received: from smtprelay0080.hostedemail.com ([216.40.44.80]:35385 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753609AbbHGPhu (ORCPT ); Fri, 7 Aug 2015 11:37:50 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2691:2828:3138:3139:3140:3141:3142:3353:3622:3653:3865:3867:3868:3870:3871:3872:3874:4321:4605:5007:6119:6261:7903:8603:10004:10400:10848:11026:11232:11658:11914:12043:12262:12295:12438:12517:12519:12555:12679:12740:13069:13161:13229:13311:13357:14096:14097:21067:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: love80_7e6592ee9f549 X-Filterd-Recvd-Size: 2598 Message-ID: <1438961867.2322.43.camel@perches.com> Subject: Re: false positives with checkpatch From: Joe Perches To: Ross Zwisler Cc: Andy Whitcroft , LKML , "sparse@chrisli.org" , Linus Torvalds Date: Fri, 07 Aug 2015 08:37:47 -0700 In-Reply-To: <1438959684.17630.4.camel@linux.intel.com> References: <1438959684.17630.4.camel@linux.intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1910 Lines: 65 On Fri, 2015-08-07 at 09:01 -0600, Ross Zwisler wrote: > When running checkpatch.pl against my latest patch set, I hit what I think are > two false positives. Here are the related lines: > > +static inline void flush_cache_pmem(void __pmem *addr, size_t size) > +{ > + if (arch_has_pmem_api()) > + arch_flush_cache_pmem(addr, size); > +} > > The error was: > > ERROR: need consistent spacing around '*' (ctx:WxV) > #88: FILE: include/linux/pmem.h:167: > +static inline void flush_cache_pmem(void __pmem *addr, size_t size) > ^ > The (void __annotation *variable) syntax is correct, I believe, and is used > consistently for both __iomem and __pmem annotations. checkpatch doesn't know what a __pmem is. Neither did I until a second ago. Are there any other sparse annotations that were added by this subsystem? (I don't notice any) They need to be added to checkpatch's $Sparse use so there's a patch proposal below this. It looks like compiler.h's #define __safe is unused in the linux kernel and it could be deleted as it's not a gcc attribute. Does anyone know? Linus' commit is unrevealing. commit e6b8f25bd950947d06c59432cbafd320dda66abf Author: Linus Torvalds Date: Fri Apr 16 03:49:32 2004 -0700 Add sparse __safe annotation --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index fd8e502..6362ec3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -264,6 +264,7 @@ our $Sparse = qr{ __kernel| __force| __iomem| + __pmem| __must_check| __init_refok| __kprobes| -- 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/