DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mcnamara, John" <john.mcnamara@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Cc: "Legacy, Allain (Wind River)" <allain.legacy@windriver.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] devtools: add long lines to the list of	options
Date: Thu, 2 Mar 2017 12:49:50 +0000	[thread overview]
Message-ID: <B27915DBBA3421428155699D51E4CFE2026DDD89@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <5086780.mtiN8QzXmL@xps13>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Wednesday, March 1, 2017 6:39 PM
> To: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Legacy, Allain (Wind River) <allain.legacy@windriver.com>;
> dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] devtools: add long lines to the list of
> options
> 
> 2017-03-01 10:08, Stephen Hemminger:
> > > --- a/devtools/checkpatches.sh
> > > +++ b/devtools/checkpatches.sh
> > > @@ -45,7 +45,7 @@ options="$options
> > > --ignore=LINUX_VERSION_CODE,FILE_PATH_CHANGES,\
> > >  VOLATILE,PREFER_PACKED,PREFER_ALIGNED,PREFER_PRINTF,\
> > >  PREFER_KERNEL_TYPES,BIT_MACRO,CONST_STRUCT,\
> > >
> > > SPLIT_STRING,LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COM
> > > MENT_STYLE,\
> > > -NEW_TYPEDEFS,COMPARISON_TO_NULL"
> > > +NEW_TYPEDEFS,COMPARISON_TO_NULL,LONG_LINE_STRING"
> >
> > Maybe it is time to have our own DPDK version of checkpatch which
> > knows about DPDK API's like logging functions?
> 
> It is Perl code!
> If we can have a reliable maintainer, why not.

It is not a big change. Something like the following would fix most of
the warnings:

$ git diff
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a8368d1..32981af 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -429,6 +429,7 @@ our $logFunctions = qr{(?x:
        WARN(?:_RATELIMIT|_ONCE|)|
        panic|
        MODULE_[A-Z_]+|
+       PMD_[A-Z_]+_LOG|RTE_LOG|
        seq_vprintf|seq_printf|seq_puts
 )};


However, putting the long string on its own line generally fixes the warning
while keeping the string greppable. 

Something like this (from the patch that triggered this discussion):

	if (eth_dev->data->mac_addrs == NULL) {
		PMD_DRV_LOG(ERR,
			    "Failed to allocate %d bytes needed to store MAC addresses\n",
			    ETHER_ADDR_LEN);
		return -ENOMEM;
	}

Instead of the original:

	if (eth_dev->data->mac_addrs == NULL) {
		PMD_DRV_LOG(ERR, "Failed to allocate %d bytes needed to store MAC addresses\n",
			    ETHER_ADDR_LEN);
		return -ENOMEM;
	}

John

  reply	other threads:[~2017-03-02 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 17:44 Allain Legacy
2017-03-01 18:08 ` Stephen Hemminger
2017-03-01 18:38   ` Thomas Monjalon
2017-03-02 12:49     ` Mcnamara, John [this message]
2017-03-02 13:04   ` Gaëtan Rivet
2017-03-06 15:03 ` Thomas Monjalon

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=B27915DBBA3421428155699D51E4CFE2026DDD89@IRSMSX103.ger.corp.intel.com \
    --to=john.mcnamara@intel.com \
    --cc=allain.legacy@windriver.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas.monjalon@6wind.com \
    /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).