* [dpdk-dev] checkpatch.pl inconsistent results
@ 2017-02-25 11:54 Legacy, Allain
2017-02-26 9:12 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Legacy, Allain @ 2017-02-25 11:54 UTC (permalink / raw)
To: dev
Hi,
I sent a patchset to the to the mailing list last night for which I received several coding style warnings. Having discovered that I was using an older version of checkpatch.pl I downloaded the latest and set out to fix the warnings. The tool is flagging the usage of PRIx64 and PRIu64 in debug logs as camelcase warnings. I am unsure how to get around this. Looking at other recent patches in patchwork I see that other patches use these macros without being flagged as errors.
I thought perhaps that my version of checkpath.pl was newer because I just downloaded it so I ran it on one of the other patchwork patches to validate my results. The results that I get are a bit confusing. Running checkpatches.sh on this patch (http://dpdk.org/dev/patchwork/patch/19766/) reports no errors, warnings, or checks while this one (http://dpdk.org/dev/patchwork/patch/20742/) flags two different kinds of errors related to the usage of PRIx64. It complains about the camelcase aspect of it, and it also complains about the lack of space between the PRIx64 and the concatenated strings at either side.
Can anyone shed some light on why this is happening?
Regards,
Allain
Allain Legacy, Software Developer
direct 613.270.2279 fax 613.492.7870 skype allain.legacy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] checkpatch.pl inconsistent results
2017-02-25 11:54 [dpdk-dev] checkpatch.pl inconsistent results Legacy, Allain
@ 2017-02-26 9:12 ` Thomas Monjalon
2017-02-26 16:20 ` Legacy, Allain
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2017-02-26 9:12 UTC (permalink / raw)
To: Legacy, Allain; +Cc: dev
2017-02-25 11:54, Legacy, Allain:
> Hi,
> I sent a patchset to the to the mailing list last night for which I received several coding style warnings. Having discovered that I was using an older version of checkpatch.pl I downloaded the latest and set out to fix the warnings. The tool is flagging the usage of PRIx64 and PRIu64 in debug logs as camelcase warnings. I am unsure how to get around this. Looking at other recent patches in patchwork I see that other patches use these macros without being flagged as errors.
It is a false positive.
PRIx64 and PRIu64 are obviously allowed.
The only thing you need to take care is having spaces around.
> I thought perhaps that my version of checkpath.pl was newer because I just downloaded it so I ran it on one of the other patchwork patches to validate my results. The results that I get are a bit confusing. Running checkpatches.sh on this patch (http://dpdk.org/dev/patchwork/patch/19766/) reports no errors, warnings, or checks while this one (http://dpdk.org/dev/patchwork/patch/20742/) flags two different kinds of errors related to the usage of PRIx64. It complains about the camelcase aspect of it, and it also complains about the lack of space between the PRIx64 and the concatenated strings at either side.
>
> Can anyone shed some light on why this is happening?
Maybe the difference is because the first one happens in a standard
printf function and checkpatch would ignore the specifiers.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] checkpatch.pl inconsistent results
2017-02-26 9:12 ` Thomas Monjalon
@ 2017-02-26 16:20 ` Legacy, Allain
2017-02-26 16:42 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Legacy, Allain @ 2017-02-26 16:20 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Sunday, February 26, 2017 4:12 AM
> To: Legacy, Allain
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] checkpatch.pl inconsistent results
> Importance: High
>
> 2017-02-25 11:54, Legacy, Allain:
...
>
> It is a false positive.
> PRIx64 and PRIu64 are obviously allowed.
> The only thing you need to take care is having spaces around.
>
Ok, thanks Thomas. Obviously PRIx64 and PRIu64 are acceptable so I knew that something must have been wrong with my understanding or what I was doing. I'll ignore these and proceed to fixing the other issues missed because of the older version of checkpatch.pl that I was using. Is there a list of acceptable false positives to avoid wasting time trying to figure these out?
> Maybe the difference is because the first one happens in a standard
> printf function and checkpatch would ignore the specifiers.
Just for curiosity sake I copied the line from my change in to the other patch that I mentioned and the checkpath.pl tool did not flag an error so it seems like it may be file path dependent. Since it is a false positive I won't waste any time trying to chase this down any further.
On the subject of using the correct version of checkpath.pl, has there been any discussions around storing a version of this tool in the dpdk tree to avoid developers using one version while the automated tools use another, or even so that all developers are using the same version at any given time? It has always been my experience that it is better to version control as many of the dependent tools as possible to ensure repeatable and predictable results. If storing a version of the script in the dpdk tree is unacceptable then perhaps automatically downloading a copy from kernel.org at runtime would be better?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] checkpatch.pl inconsistent results
2017-02-26 16:20 ` Legacy, Allain
@ 2017-02-26 16:42 ` Thomas Monjalon
2017-02-26 17:31 ` Legacy, Allain
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2017-02-26 16:42 UTC (permalink / raw)
To: Legacy, Allain; +Cc: dev
2017-02-26 16:20, Legacy, Allain:
> From: Thomas Monjalon
> > It is a false positive.
> > PRIx64 and PRIu64 are obviously allowed.
> > The only thing you need to take care is having spaces around.
> >
> Ok, thanks Thomas. Obviously PRIx64 and PRIu64 are acceptable so I knew that something must have been wrong with my understanding or what I was doing. I'll ignore these and proceed to fixing the other issues missed because of the older version of checkpatch.pl that I was using. Is there a list of acceptable false positives to avoid wasting time
trying to figure these out?
No we have no such list.
We could add one in the contribution guide, or we could try to catch them
in checkpatch.sh, or even better, we could try to contribute a change in
Linux repo.
> > Maybe the difference is because the first one happens in a standard
> > printf function and checkpatch would ignore the specifiers.
>
> Just for curiosity sake I copied the line from my change in to the other patch that I mentioned and the checkpath.pl tool did not flag an error so it seems like it may be file path dependent. Since it is a false positive I won't waste any time trying to chase this down any further.
>
> On the subject of using the correct version of checkpath.pl, has there been any discussions around storing a version of this tool in the dpdk tree to avoid developers using one version while the automated tools use another, or even so that all developers are using the same version at any given time? It has always been my experience that it is better to version control as many of the dependent tools as possible to ensure repeatable and predictable results. If storing a version of the script in the dpdk tree is unacceptable then perhaps automatically downloading a copy from kernel.org at runtime would be better?
Yes it has been discussed few times.
I don't see any issue at having different results, because the main benefit
of checkpatch is to help in reviews. If a new tool or version helps to have
a better code, it's fine but it is probably not a big issue.
I do not like the idea of saving a copy of checkpatch in DPDK (we won't
maintain it and it could be used by several DPDK repositories).
I think we can add an automatic download from kernel.org if the script
is not found. However it won't fix the versioning.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] checkpatch.pl inconsistent results
2017-02-26 16:42 ` Thomas Monjalon
@ 2017-02-26 17:31 ` Legacy, Allain
0 siblings, 0 replies; 5+ messages in thread
From: Legacy, Allain @ 2017-02-26 17:31 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Sunday, February 26, 2017 11:42 AM
> To: Legacy, Allain
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] checkpatch.pl inconsistent results
...
> Yes it has been discussed few times.
> I don't see any issue at having different results, because the main benefit of
> checkpatch is to help in reviews. If a new tool or version helps to have a
> better code, it's fine but it is probably not a big issue.
> I do not like the idea of saving a copy of checkpatch in DPDK (we won't
> maintain it and it could be used by several DPDK repositories).
> I think we can add an automatic download from kernel.org if the script is not
> found. However it won't fix the versioning.
Ok, I guess what I meant was that the automatic download could fetch the tool from a specific commit id (not master), and we could update the commit id that we want to use on a periodic basis. That way at least everyone is at the same baseline at any given snapshot in time and results would be reproducible if we had to revert back to an earlier stable branch to port a fix.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-26 17:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-25 11:54 [dpdk-dev] checkpatch.pl inconsistent results Legacy, Allain
2017-02-26 9:12 ` Thomas Monjalon
2017-02-26 16:20 ` Legacy, Allain
2017-02-26 16:42 ` Thomas Monjalon
2017-02-26 17:31 ` Legacy, Allain
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).