From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756970AbdJKD3N (ORCPT ); Tue, 10 Oct 2017 23:29:13 -0400 Received: from smtprelay0092.hostedemail.com ([216.40.44.92]:52028 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751952AbdJKD3M (ORCPT ); Tue, 10 Oct 2017 23:29:12 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2110:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3150:3352:3622:3865:3870:3871:3874:4321:5007:10004:10400:10848:11026:11232:11658:11914:12294:12296:12740:12760:12895:13069:13071:13311:13357:13439:14096:14097:14180:14181:14659:14721:21060:21080:21433:21451:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:38,LUA_SUMMARY:none X-HE-Tag: elbow45_503668ae64b24 X-Filterd-Recvd-Size: 1739 Message-ID: <1507692549.3552.43.camel@perches.com> Subject: Re: [PATCH] scripts/checkpatch.pl: fix false warning of externschecking. From: Joe Perches To: jiang.biao2@zte.com.cn Cc: apw@canonical.com, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn Date: Tue, 10 Oct 2017 20:29:09 -0700 In-Reply-To: <201710111121397732689@zte.com.cn> References: 1507624970-4609-1-git-send-email-jiang.biao2@zte.com.cn,1507625682.3552.30.camel@perches.com <201710111121397732689@zte.com.cn> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 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 On Wed, 2017-10-11 at 11:21 +0800, jiang.biao2@zte.com.cn wrote: > > On Tue, 2017-10-10 at 16:42 +0800, Jiang Biao wrote: > > > When adding a function declaration in a .c file without an extern > > > keywork decoration, checkpatch.pl will complain *externs should be > > > avoided in .c files* false warning. This patch fix the bug. > > nack. > > The point is that external function declarations should be > > done via #include. > Hi Joe, Hello Jiang > Understood. But there are already some external function declarations in > .c files in current kernel, for instance line 505 in kernel/stop_machine.c, > > extern void sched_set_stop_task(int cpu, struct task_struct *stop); > > Should these be fixed? But maybe in some rare cases, external funciton > declarations in .c files are necessary. Perhaps, but in those cases checkpatch messages should be ignored. cheers, Joe