Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1799426pxb; Sat, 4 Sep 2021 23:01:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrjrudgfYNyM46gGvT7OLyE6ya6sVoVSzkusv+gjGMXfQU198CdprGD6uQ6opBhjP+YDaL X-Received: by 2002:a02:3846:: with SMTP id v6mr5633358jae.45.1630821682343; Sat, 04 Sep 2021 23:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630821682; cv=none; d=google.com; s=arc-20160816; b=rMh4zqNNsSnjQkhPcoh/rWhXBA2wlZ/A1YIuEXo0C1MH1jjIwfafO95Ilh51QjUyii KBJCVib0GfM3XBGqDayDOtirnFnNuce/jg8JTIRkW/cG3eO7nNrfkchUPVZN4opy5pW2 HVnrlRIeUy5aVCt5Y8pctlPtYSWLsFefOmuv7/J4JYrDDkFyTkBWOlAIJZHG1jBjBepG PrhM1l4FMCbf40dnbWUxBl1KF2Ab+uF5LTlk1qcuW1Sq/adz9jSCxKh+POPZ27lFwSkm veNXl5pMi5W93n1w9Ua4xlQ0+flifH0YmDrnLFlLCufxEtTyr5X3OM9IVkEGWoh1fIPH GfDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=AVSOxGunqeMk8aG12KQevlW/trhkNZgVznEo5R5nITI=; b=pxPK0bpvmC3eK2R1KnZm9cE8JC7W1eRipeywXFpbke+MtTEXETfkdSMIzbES7e9fe/ /RyCpv9eYAgpAwiFJ540qPceJYMTyw8+l4OmH70FUUj3ylXaR7KrFy5HJgrN7cyyMCEB SB5zOeB/+Iec78LxZ0tPaLcrdRIVBfvx+RyylEqpsBWZhfd3joB2xANPbLkaEtavoEuX qtcElGf7qEsmkrlFO3ytZJBAJNTvve1AaJB3YiwItoDcZ2zhkR8Ln+2xGmY6a6SgjCTt JyyOLCcl1IUd/a1+2FUoydrVFRCKFbroeMmGN4EKstaN8baAkPZ59/qRjS1PkKTQ4Xoe Pj2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si3572758jaj.45.2021.09.04.23.01.09; Sat, 04 Sep 2021 23:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233838AbhIEFwH (ORCPT + 99 others); Sun, 5 Sep 2021 01:52:07 -0400 Received: from smtprelay0202.hostedemail.com ([216.40.44.202]:41606 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231835AbhIEFwH (ORCPT ); Sun, 5 Sep 2021 01:52:07 -0400 Received: from omf13.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 3B95F18029120; Sun, 5 Sep 2021 05:51:03 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA id 4C9211124F6; Sun, 5 Sep 2021 05:51:02 +0000 (UTC) Message-ID: Subject: Re: False positive EXPORT_SYMBOL warning with NS variants From: Joe Perches To: Ian Pilcher , Andy Whitcroft Cc: Dwaipayan Ray , Lukas Bulwahn , "linux-kernel@vger.kernel.org" Date: Sat, 04 Sep 2021 22:51:01 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Stat-Signature: 6z4p4ncebhtatfckqumese6s5hzf9wgh X-Rspamd-Server: rspamout03 X-Rspamd-Queue-Id: 4C9211124F6 X-Spam-Status: No, score=6.61 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+/UJs1hLVSao1Xv6OwxuW4dmpYsesQkxk= X-HE-Tag: 1630821062-600752 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-09-03 at 11:01 -0500, Ian Pilcher wrote: > $ cat foo.c > // SPDX-License-Identifier: GPL-2.0-only > void (*foo)(void); > EXPORT_SYMBOL_NS(foo, FOO); > > $ scripts/checkpatch.pl -f foo.c > WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable > #3: FILE: foo.c:3: > +EXPORT_SYMBOL_NS(foo, FOO); > > The non-NS EXPORT_SYMBOL variants don't trigger this warning. > Try this: --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 88cb294dc4472..91798b07c6cb5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4449,6 +4449,7 @@ sub process { # XXX(foo); # EXPORT_SYMBOL(something_foo); my $name = $1; + $name =~ s/^\s*($Ident).*/$1/; if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ && $name =~ /^${Ident}_$2/) { #print "FOO C name<$name>\n";