From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8C7FFA00C2; Sat, 25 Apr 2020 13:03:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D54D61C23D; Sat, 25 Apr 2020 13:02:29 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E4EEE1C1CE for ; Sat, 25 Apr 2020 13:02:25 +0200 (CEST) IronPort-SDR: KJBs02dgXOB8cMBRFmpZBlKiicl7IlLO+4vO8dIRcuSkZFWsDL+mBzGr9rsZNezWApueZh5HIm 5a+HbTc/Slzg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2020 04:02:25 -0700 IronPort-SDR: mo1k10ZchruJ1iIkOusVM5LhvYQVTY3Kptxo5Rtt1/OBA/g0P4wL/2JN8YfjdOwdVxmW57UCvh USj0C/axMsjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,315,1583222400"; d="scan'208";a="457729327" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga005.fm.intel.com with ESMTP; 25 Apr 2020 04:02:23 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 18:56:20 +0800 Message-Id: <20200425105620.73021-7-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425105620.73021-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425105620.73021-1-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v7 6/6] devtools: enforce internal tag at the beginning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Move the internal tag on a separate line and make it the first thing of function prototypes. Signed-off-by: Haiyue Wang --- devtools/checkpatches.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index c30ce64cc..42b833e0d 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -111,6 +111,37 @@ check_experimental_tags() { # return $res } +check_internal_tags() { # + res=0 + + cat "$1" |awk ' + BEGIN { + current_file = ""; + ret = 0; + } + /^+++ b\// { + current_file = $2; + } + /^+.*__rte_internal/ { + if (current_file ~ ".c$" ) { + print "Please only put __rte_internal tags in " \ + "headers ("current_file")"; + ret = 1; + } + if ($1 != "+__rte_internal" || $2 != "") { + print "__rte_internal must appear alone on the line" \ + " immediately preceding the return type of" \ + " a function." + ret = 1; + } + } + END { + exit ret; + }' || res=1 + + return $res +} + number=0 range='origin/master..' quiet=false @@ -194,6 +225,14 @@ check () { # ret=1 fi + ! $verbose || printf '\nChecking __rte_internal tags:\n' + report=$(check_internal_tags "$tmpinput") + if [ $? -ne 0 ] ; then + $headline_printed || print_headline "$3" + printf '%s\n' "$report" + ret=1 + fi + if [ "$tmpinput" != "$1" ]; then rm -f "$tmpinput" trap - INT -- 2.26.2