From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5CDED2B88 for ; Thu, 2 Mar 2017 13:49:56 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2017 04:49:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,231,1484035200"; d="scan'208";a="231450757" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by fmsmga004.fm.intel.com with ESMTP; 02 Mar 2017 04:49:52 -0800 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.77]) by IRSMSX153.ger.corp.intel.com ([169.254.9.160]) with mapi id 14.03.0248.002; Thu, 2 Mar 2017 12:49:50 +0000 From: "Mcnamara, John" To: Thomas Monjalon , Stephen Hemminger CC: "Legacy, Allain (Wind River)" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] devtools: add long lines to the list of options Thread-Index: AQHSkrsag+D3/nIj9k2YhHTM94VWQ6GBf1zw Date: Thu, 2 Mar 2017 12:49:50 +0000 Message-ID: References: <1488390259-40462-1-git-send-email-allain.legacy@windriver.com> <20170301100851.60c3e46c@xeon-e3> <5086780.mtiN8QzXmL@xps13> In-Reply-To: <5086780.mtiN8QzXmL@xps13> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTgwMjNhZTUtOGZlMy00MmEwLWExNWQtNDI4YzA2ZmMwYzkxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik9cL2xEQ3pGNEFiSENDYnVQMkRHQ2Y2UmxVc2Q2MnFwdG5Qa3c2SG1sNnc0PSJ9 x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] devtools: add long lines to the list of options 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: Thu, 02 Mar 2017 12:49:57 -0000 > -----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 > Cc: Legacy, Allain (Wind River) ; > dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] devtools: add long lines to the list of > options >=20 > 2017-03-01 10:08, Stephen Hemminger: > > > --- a/devtools/checkpatches.sh > > > +++ b/devtools/checkpatches.sh > > > @@ -45,7 +45,7 @@ options=3D"$options > > > --ignore=3DLINUX_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? >=20 > 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 =3D 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 warnin= g while keeping the string greppable.=20 Something like this (from the patch that triggered this discussion): if (eth_dev->data->mac_addrs =3D=3D 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 =3D=3D NULL) { PMD_DRV_LOG(ERR, "Failed to allocate %d bytes needed to store MAC address= es\n", ETHER_ADDR_LEN); return -ENOMEM; } John