From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 5148A37A2 for ; Tue, 26 Jun 2018 01:04:19 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 90A6A21D76; Mon, 25 Jun 2018 19:04:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 25 Jun 2018 19:04:18 -0400 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=XOoecqKm9QBCx6PKz/ZEyr7Bsg CeS85VxsaUu7mCmlg=; b=KNe+dYfkfTJl156iKsW9V5LhTJYqa0nP/WELn5V/Vq jHinR6St7Dv89ILQA70fnz2lqqvRPTKzA6XTQpnXuFOCOaO6KvmI18RJkSe9pX9i YSfVGG27A95Ks4hfRq69lpezTQdWxfGluCgXyb9NuLGpDPoJ2MyURzRWIR7cwCH2 4= 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=fm3; bh=XOoecq Km9QBCx6PKz/ZEyr7BsgCeS85VxsaUu7mCmlg=; b=KAet7iIF3so0n2i1NOQ6hf RgWmBECbhedMRVvn13Ezk9e0iJMpzLtTm2Pm9vkTBmQzQznJ4E3su7dKdyNJejFT Hsp0PHS2yhZ6QHIyuyKZ1JesX0p0lco2XuSUSBFfZEL/1/iPTJ0yOObXx97ppqGc tP553FLoafIGpIDhhNCUGb3lS0RPzs1rXiTw4tQ0BEkn0oaz+wVPu+yKuBA8QOV0 vZGeoBt4kxS03kAGZPiu+NwP2pBg64mWBaV4NvLU6jrPL67cb/T3RYV0VfNIxYyj /jiljyHNRiYK6Po9mUAXc5Zh8WPBzKkxx8AX7cCjDckEdBaXHuMql/P016oDJdTQ == X-ME-Proxy: 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 90E88E4516; Mon, 25 Jun 2018 19:04:17 -0400 (EDT) From: Thomas Monjalon To: Neil Horman Cc: dev@dpdk.org, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit , Stephen Hemminger Date: Tue, 26 Jun 2018 01:04:16 +0200 Message-ID: <2500803.CjdbPassZA@xps> In-Reply-To: <20180614133020.15604-1-nhorman@tuxdriver.com> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180614133020.15604-1-nhorman@tuxdriver.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v8] 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: Mon, 25 Jun 2018 23:04:19 -0000 14/06/2018 15:30, Neil Horman: > * found a way to eliminate the use of filterdiff (new awk rules) Thanks a lot for not requiring filterdiff dependency. [...] > + # Just inform the user of this occurrence, but > + # don't flag it as an error > + echo -n "INFO: symbol $syname is added but " > + echo -n "patch has insuficient context " > + echo -n "to determine the section name " > + echo -n "please ensure the version is " > + echo "EXPERIMENTAL" For info, I think nowadays "printf" is preferred over "echo -n" But if you prefer "echo -n" for any reason, no problem. [...] > +exit $exit_code > + > + Ironically, this patch doesn't pass checkpatch test because of the trailing new lines. [...] > +clean_tmp_files() { > + echo $TMPINPUT | grep -q checkpaches Two comments here. Since TMPINPUT is not supposed to be overwritten by environment, I think it is better to make it lowercase (kind of convention). What the grep is supposed to match? (side note, there is a typo: checkpaches -> checkpatches) Is it to remove file only in case of mktemp? I think it is a risky pattern matching. I suggest '^checkpatches\.' > + if [ $? -eq 0 ]; then Could be easier to read if combining "if" and "grep": if echo $tmpinput | grep -q '^checkpatches\.' ; then > + rm -f $TMPINPUT > + fi > +} [...] > + TMPINPUT=$(mktemp checkpatches.XXXXXX) Open to discussion: do we prefer local dir or /tmp? Some tools are using /tmp. [...] > + report=$($DPDK_CHECKPATCH_PATH $options $TMPINPUT 2>/dev/null) > + Please, no blank line between command and test. > + 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' > + > + report=$($VALIDATE_NEW_API "$TMPINPUT") > + Same comments about blank lines. > + if [ $? -ne 0 ]; then > + printf '%s\n' "$report" > + ret=1 > + fi > + > + clean_tmp_files > + if [ $ret -eq 0 ]; then > + return 0 > fi > - [ $? -ne 0 ] || return 0 Why replacing this oneliner by a longer "if" block? After this review, I think I won't have any more comment. Thanks Neil