DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Tiwei Bie <tiwei.bie@intel.com>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>,
	"Van Haaren, Harry" <harry.van.haaren@intel.com>
Subject: Re: [dpdk-dev] [PATCH] all: refactor coding style
Date: Thu, 20 Jul 2017 12:43:40 +0530	[thread overview]
Message-ID: <e7ec7d67-612d-acf3-f3c0-3ddbf7ba30aa@nxp.com> (raw)
In-Reply-To: <20170720055309.GA975@debian-ZGViaWFuCg>

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 <tiwei.bie@intel.com>
>>> ---
> [...]
>>>    		/* 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

      reply	other threads:[~2017-07-20  7:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19  9:06 Tiwei Bie
2017-07-19  9:24 ` Van Haaren, Harry
2017-07-19 10:23   ` Tiwei Bie
2017-07-20  7:56     ` Jens Freimann
2017-07-20  8:32       ` Thomas Monjalon
2017-07-20  9:01         ` Tiwei Bie
2017-07-19 10:45 ` Trahe, Fiona
2017-07-20  5:04 ` Shreyansh Jain
2017-07-20  5:53   ` Tiwei Bie
2017-07-20  7:13     ` Shreyansh Jain [this message]

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=e7ec7d67-612d-acf3-f3c0-3ddbf7ba30aa@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=thomas@monjalon.net \
    --cc=tiwei.bie@intel.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).