[dpdk-dev] [PATCH] all: refactor coding style

Shreyansh Jain shreyansh.jain at nxp.com
Thu Jul 20 07:04:39 CEST 2017


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 at intel.com>
> ---
>   app/test-pmd/testpmd.h                             |  4 ++--
>   drivers/crypto/qat/qat_adf/icp_qat_fw.h            |  2 +-
>   drivers/event/dpaa2/dpaa2_eventdev.c               |  2 +-
>   drivers/mempool/dpaa2/dpaa2_hw_mempool.c           |  2 +-
>   drivers/net/bnx2x/bnx2x.c                          |  3 ++-
>   drivers/net/bnx2x/elink.h                          |  2 +-
>   drivers/net/e1000/igb_pf.c                         |  2 +-
>   drivers/net/ena/ena_ethdev.c                       |  4 ++--
>   drivers/net/qede/qede_ethdev.c                     |  2 +-
>   drivers/net/vhost/rte_eth_vhost.c                  |  2 +-
>   drivers/net/virtio/virtio_rxtx.c                   |  4 ++--
>   drivers/net/xenvirt/rte_eth_xenvirt.c              |  4 ++--
>   drivers/net/xenvirt/rte_xen_lib.c                  |  2 +-
>   drivers/net/xenvirt/virtqueue.h                    |  2 +-
>   examples/ip_pipeline/cpu_core_map.c                |  4 ++--
>   examples/multi_process/l2fwd_fork/main.c           |  2 +-
>   examples/netmap_compat/lib/compat_netmap.c         |  2 +-
>   examples/performance-thread/l3fwd-thread/main.c    |  2 +-
>   examples/qos_sched/app_thread.c                    |  2 +-
>   examples/quota_watermark/qw/main.c                 |  2 +-
>   examples/vhost_xen/xenstore_parse.c                |  3 +--
>   lib/librte_distributor/rte_distributor.c           | 12 +++++-----
>   lib/librte_eal/linuxapp/eal/eal_memory.c           |  2 +-
>   lib/librte_eal/linuxapp/eal/eal_xen_memory.c       |  2 +-
>   lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c |  4 ++--
>   .../linuxapp/kni/ethtool/ixgbe/ixgbe_main.c        |  2 +-
>   .../linuxapp/kni/ethtool/ixgbe/kcompat.c           |  2 +-
>   lib/librte_ether/rte_ethdev.c                      |  2 +-
>   lib/librte_sched/rte_approx.c                      |  8 +++----
>   lib/librte_sched/rte_bitmap.h                      |  3 ++-
>   test/test/test_cryptodev.c                         |  2 +-
>   test/test/test_cryptodev_perf.c                    | 26 +++++++++++-----------
>   test/test/test_eventdev_sw.c                       |  2 +-
>   test/test/test_malloc.c                            |  4 ++--
>   test/test/test_memory.c                            |  2 +-
>   test/test/test_mempool.c                           |  2 +-
>   test/test/test_ring.c                              |  6 ++---
>   test/test/test_table_acl.c                         |  2 +-
>   test/test/test_table_pipeline.c                    |  2 +-
>   39 files changed, 69 insertions(+), 70 deletions(-)
> 

[...]

I agree with Harry's comments (in another reply to this thread) that 
such patches might impact other pending patch series, quite late in 
merge window. But, this is a good-to-have set, probably early in 1711 
window.

>   		/* 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.

[...]

Other than the above (and also from dpaa2 code change perspective):

Acked-by: Shreyansh Jain <shreyansh.jain at nxp.com>


More information about the dev mailing list