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 A100FA00C2; Sat, 25 Apr 2020 08:11:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E8D31C208; Sat, 25 Apr 2020 08:10:49 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2ACA31C1EA for ; Sat, 25 Apr 2020 08:10:45 +0200 (CEST) IronPort-SDR: Me/ZSxbYx9sJBF/eD88xnU9B75/whzyI/E6XfGK7FXFrZ71Kh18aXUS489rB9cDcnUHgNJTYDS 1T2NezLfkpPg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:44 -0700 IronPort-SDR: gpTjcYDL6k5EpDAjK1e6iWzZ3uUo6XieqPYu094qWQQ3byQtkOAnHvs2dT6GGtQKStylDNdqAm gsiHGMZdKeWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099215" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:43 -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 14:04:41 +0800 Message-Id: <20200425060441.36874-7-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 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