From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 9D0AE1E20 for ; Tue, 13 Feb 2018 23:57:37 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 26B1D21A0B; Tue, 13 Feb 2018 17:57:37 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 13 Feb 2018 17:57:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=k3FN8eDWHR5PjaF6HjWC59c+oP Z9n3Naptp4VW/xId8=; b=I0H3sxbh58Bb39MrYxOM51olzpUVSEAVxgt08FNPQi wyssugdy6mABr2vIWipGpxTIH4U7EeGd+hlnmKX82XAvUDMyDH4JZJ69XgkAeK6a lfmKQaX9a50QmVs+Kbu7s0tZL+KRaT6tlVC0Tcyq+HSiIFdTA8d8JP++lizH/x4L Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=k3FN8e DWHR5PjaF6HjWC59c+oPZ9n3Naptp4VW/xId8=; b=AKOhRrl61DPcp32f5UXkbF IRFog6xQgbgZV0eGW1Firy2A4JyGkA/xSPFj7ST9SAumEqYmpohUmAbkfbglNp1s ar52Yd6d2s5VgQyjhlHH0cSxSKyvsvCpqNR4YjiKaU9+YvpM82jlHHL4fanSiXfN xduJOoOzBJsPZ/baNmWJiNy5hIdBUgymZRYpS6jhDu/6+8DIj7klyIKHg8o/j1or 30YWezYdmNEoIEQwqPFs3Sy334jL08TNDvv5BYoDMmLfBKxdJJHkxxmeL2MY6Wkk ISwnpRSFV8AIUjNVVhrxhUhuC9NPIjAr9wtcef3BCOrYTR01YLee3/Laajb0UKdA == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BF9B324547; Tue, 13 Feb 2018 17:57:36 -0500 (EST) From: Thomas Monjalon To: Neil Horman Cc: dev@dpdk.org, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit , Stephen Hemminger Date: Tue, 13 Feb 2018 23:57:27 +0100 Message-ID: <2575844.FsKHahjUk7@xps> In-Reply-To: <20180209152111.2508-1-nhorman@tuxdriver.com> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180209152111.2508-1-nhorman@tuxdriver.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v5] checkpatches.sh: Add checks for ABI symbol addition 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: , X-List-Received-Date: Tue, 13 Feb 2018 22:57:37 -0000 Hi, I wanted to push this patch in 18.02, but when looking more closely, I see few things to improve. As it is a tool, there is no harm to wait one more week and push it early in 18.05. 09/02/2018 16:21, Neil Horman: > check () { # > + local reta > total=$(($total + 1)) > ! $verbose || printf '\n### %s\n\n' "$3" > if [ -n "$1" ] ; then > @@ -96,9 +100,26 @@ check () { # <patch> <commit> <title> > else > report=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null) > fi > - [ $? -ne 0 ] || return 0 You are removing the return, so the report will be always printed. You must print the report only in case of error. > + reta=$? > + > $verbose || printf '\n### %s\n\n' "$3" > printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' > + > + ! $verbose || echo > + ! $verbose || echo "Checking API additions/removals:" You can use printf to combine these lines. > + > + if [ -n "$1" ] ; then > + report=$($VALIDATE_NEW_API $1) Beware of spaces in file names: use quoted "$1". > + elif [ -n "$2" ] ; then > + report=$(git format-patch \ > + --find-renames --no-stat --stdout -1 $commit | > + $VALIDATE_NEW_API -) > + else > + report=$($VALIDATE_NEW_API -) So your script supports "-" for stdin? Nice > + fi > + [ $? -ne 0 -o $reta -ne 0 ] || return 0 Suggestion of more explicit variable naming: $reta -> style_result $? -> symbol_result > + printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' Wrong copy/paste: the sed is useless for the API report.