From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v6] checkpatches.sh: Add checks for ABI symbol addition Date: Sun, 27 May 2018 21:34:13 +0200 Message-ID: <1725451.L7JxISGBU9@xps> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180214191916.7226-1-nhorman@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit , Stephen Hemminger To: Neil Horman Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id E8AF52C52 for ; Sun, 27 May 2018 21:34:16 +0200 (CEST) In-Reply-To: <20180214191916.7226-1-nhorman@tuxdriver.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Neil, Sorry, this patch has been forgotten during the whole release cycle. I see an issue about the dependency on filterdiff. Is there a way to avoid it? I have some minor comments below. 14/02/2018 20:19, Neil Horman: > @@ -61,6 +65,7 @@ print_usage () { > END_OF_HELP > } > > + This new blank line is probably a leftover. > number=0 > quiet=false > verbose=false > @@ -86,19 +91,50 @@ total=0 > status=0 > > check () { # > + local ret=0 > + TMPINPUT=`mktemp checkpatches.XXXXXX` It is preferred to use $() construct to be consistent in the file. > + > total=$(($total + 1)) > ! $verbose || printf '\n### %s\n\n' "$3" > if [ -n "$1" ] ; then > report=$($DPDK_CHECKPATCH_PATH $options "$1" 2>/dev/null) > elif [ -n "$2" ] ; then > - report=$(git format-patch --find-renames --no-stat --stdout -1 $commit | > + git format-patch --find-renames --no-stat --stdout -1 $commit > ./$TMPINPUT > + report=$(cat ./$TMPINPUT | > $DPDK_CHECKPATCH_PATH $options - 2>/dev/null) No need to use cat here. > else > - report=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null) > + cat > ./$TMPINPUT > + report=$(cat ./$TMPINPUT | $DPDK_CHECKPATCH_PATH $options - 2>/dev/null) > + fi All calls to DPDK_CHECKPATCH_PATH can be moved to one call after the "fi". Just need to set TPMINPUT=$1 in first case (and not remove TPMINPUT in this case). > + if [ $? -ne 0 ] > + then For consistency, the style in this file is: if [ $? -ne 0 ] ; then > + $verbose || printf '\n### %s\n\n' "$3" > + printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' > + ret=1 > + fi > + > + ! $verbose || printf '\nChecking API additions/removals:\n' > + > + if [ -n "$1" ] ; then > + report=$($VALIDATE_NEW_API "$1") > + elif [ -n "$2" ] ; then > + report=$( cat ./$TMPINPUT | > + $VALIDATE_NEW_API -) > + else > + report=$(cat ./$TMPINPUT | $VALIDATE_NEW_API -) > + fi Same as above, it can be simplified by only one line for all cases.