From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH] all: refactor coding style Date: Thu, 20 Jul 2017 12:43:40 +0530 Message-ID: References: <1500455196-182365-1-git-send-email-tiwei.bie@intel.com> <39182ae5-d8e1-f84a-6701-2732dfbfdb5f@nxp.com> <20170720055309.GA975@debian-ZGViaWFuCg> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , "Van Haaren, Harry" To: Tiwei Bie Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0072.outbound.protection.outlook.com [104.47.33.72]) by dpdk.org (Postfix) with ESMTP id 889D02C50 for ; Thu, 20 Jul 2017 09:04:24 +0200 (CEST) In-Reply-To: <20170720055309.GA975@debian-ZGViaWFuCg> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thursday 20 July 2017 11:23 AM, Tiwei Bie wrote: > On Thu, Jul 20, 2017 at 10:34:39AM +0530, Shreyansh Jain wrote: >> On Wednesday 19 July 2017 02:36 PM, Tiwei Bie wrote: >>> Remove the unwanted spaces before `;' across DPDK source code >>> by below one-liner with some minor manual refinements. >>> >>> find . -name '*.[ch]' | xargs sed -i 's/\([^;(]\) \+;/\1;/g' >>> >>> The fixes for cmdline library are skipped, because it has a >>> different coding style. It deserves a separate cleanup if >>> necessary. The fixes for drivers' base code are also skipped >>> to keep the base code intact. >>> >>> Signed-off-by: Tiwei Bie >>> --- > [...] >>> /* compute the number of steps to the right */ >>> diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.h >>> index 010d752..e487b58 100644 >>> --- a/lib/librte_sched/rte_bitmap.h >>> +++ b/lib/librte_sched/rte_bitmap.h >>> @@ -500,7 +500,8 @@ __rte_bitmap_scan_read(struct rte_bitmap *bmp, uint32_t *pos, uint64_t *slab) >>> uint64_t *slab2; >>> slab2 = bmp->array2 + bmp->index2; >>> - for ( ; bmp->go2 ; bmp->index2 ++, slab2 ++, bmp->go2 = bmp->index2 & RTE_BITMAP_CL_SLAB_MASK) { >>> + for ( ; bmp->go2; bmp->index2++, slab2++, >>> + bmp->go2 = bmp->index2 & RTE_BITMAP_CL_SLAB_MASK) { >> >> ^^^^ >> Trivial: space before ';' in 'for' here should also be removed. >> > > Thank you for your feedbacks! :-) > > Hmm.. Actually the space between `(' and `;' was kept intentionally > when I wrote this 's/\([^;(]\) \+;/\1;/g' sed script. There are many > other such cases. It's acceptable to me, and I thought we like it: Ok. > > diff --git i/app/test-eventdev/parser.h w/app/test-eventdev/parser.h > index 75a5a3b..372b85f 100644 > --- i/app/test-eventdev/parser.h > +++ w/app/test-eventdev/parser.h > @@ -41,7 +41,7 @@ > #define skip_white_spaces(pos) \ > ({ \ > __typeof__(pos) _p = (pos); \ > - for ( ; isspace(*_p); _p++) \ > + for (; isspace(*_p); _p++) \ > ; \ > _p; \ [...] That is a long list of change :). IMO, we should remove the space (in which case I agree with your change) - but, this is a more of a acceptable-coding-standards issue and I am not sure what the agreed standard for DPDK is in this case. Maybe Thomas can comment. - Shreyansh