DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, john.mcnamara@intel.com,
	bruce.richardson@intel.com, Ferruh Yigit <ferruh.yigit@intel.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [dpdk-dev] [PATCH v8] checkpatches.sh: Add checks for ABI symbol addition
Date: Wed, 27 Jun 2018 13:58:31 -0400	[thread overview]
Message-ID: <20180627175831.GA15437@hmswarspite.think-freely.org> (raw)
In-Reply-To: <2500803.CjdbPassZA@xps>

On Tue, Jun 26, 2018 at 01:04:16AM +0200, Thomas Monjalon wrote:
> 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.
> 
I prefer echo, just because its what I've always used.  I'm open to changing it
if there is a compelling reason to do so.

> [...]
> > +exit $exit_code
> > +
> > +
> 
> Ironically, this patch doesn't pass checkpatch test because of
> the trailing new lines.
> 
Patchwork reports only a single error:
https://patches.dpdk.org/patch/41139/

Is the CI checkpatch different from the checkpatch we provide here?  If so, why?

> [...]
> > +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).
> 
Sure

> What the grep is supposed to match?
The name of the temp file created.  TMPINPUT can take on two classes of values:
1) The name of a passed in patch file
2) The name of a temp file created to hold a patch streamed in on stdin

when we clean up on exit, we want to delete class 2, but never class 1, so we
match on the temp file root name 'checkpatch'

> (side note, there is a typo: checkpaches -> checkpatches)
will fix

> Is it to remove file only in case of mktemp?
yes

> I think it is a risky pattern matching. I suggest '^checkpatches\.'
fine

> 
> > +	if [ $? -eq 0 ]; then
> 
> Could be easier to read if combining "if" and "grep":
> 	if echo $tmpinput | grep -q '^checkpatches\.' ; then
That seems fairly out of line with the style of the rest of the file

> 
> > +		rm -f $TMPINPUT
> > +	fi
> > +}
> 
> [...]
> > +		TMPINPUT=$(mktemp checkpatches.XXXXXX)
> 
> Open to discussion: do we prefer local dir or /tmp?
> Some tools are using /tmp.
> 
I don't think thats our call.  If an end user wants to specify the location of
temp files, they can do so by setting $TMPDIR.  We don't need to mandate it.

> [...]
> > +	report=$($DPDK_CHECKPATCH_PATH $options $TMPINPUT 2>/dev/null)
> > +
> 
> Please, no blank line between command and test.
> 
very well

> > +	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?
> 
Because it was in keeping with the style that I was working with.  I can revert
it

> After this review, I think I won't have any more comment.
> Thanks Neil
> 
> 
> 

  reply	other threads:[~2018-06-27 17:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 19:05 [dpdk-dev] [PATCH] " Neil Horman
2018-01-15 21:52 ` Thomas Monjalon
2018-01-16  0:37   ` Neil Horman
2018-01-15 22:20 ` Stephen Hemminger
2018-01-16  0:36   ` Neil Horman
2018-01-16 18:22 ` [dpdk-dev] [PATCH v2] " Neil Horman
2018-01-21 20:29   ` Thomas Monjalon
2018-01-22  1:54     ` Neil Horman
2018-01-22  2:05       ` Thomas Monjalon
2018-01-31 17:27 ` [dpdk-dev] [PATCH v3] " Neil Horman
2018-02-04 14:44   ` Thomas Monjalon
2018-02-05 17:29 ` [dpdk-dev] [PATCH v4] " Neil Horman
2018-02-05 17:57   ` Thomas Monjalon
2018-02-09 15:21 ` [dpdk-dev] [PATCH v5] " Neil Horman
2018-02-13 22:57   ` Thomas Monjalon
2018-02-14 19:19 ` [dpdk-dev] [PATCH v6] " Neil Horman
2018-05-27 19:34   ` Thomas Monjalon
2018-05-27 21:00     ` Neil Horman
2018-05-27 22:01       ` Thomas Monjalon
2018-05-28 17:08         ` Neil Horman
2018-06-05 12:21 ` [dpdk-dev] [PATCH v7] " Neil Horman
2018-06-14 13:30 ` [dpdk-dev] [PATCH v8] " Neil Horman
2018-06-25 23:04   ` Thomas Monjalon
2018-06-27 17:58     ` Neil Horman [this message]
2018-06-27 18:01 ` [dpdk-dev] [PATCH v9] " Neil Horman
2018-07-15 23:12   ` Thomas Monjalon
2018-08-14  3:53   ` Rao, Nikhil
2018-08-14 11:04     ` Neil Horman
2018-08-15  6:10       ` Nikhil Rao
2018-08-15 10:48         ` Neil Horman
2018-08-16  6:19           ` Rao, Nikhil
2018-08-16 10:42             ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180627175831.GA15437@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).