Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: xiangxia.m.yue@gmail.com
Cc: davem@davemloft.net, pshelar@ovn.org, xiyou.wangcong@gmail.com,
	dev@openvswitch.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3 1/3] net: openvswitch: improve coding style
Date: Tue, 25 Aug 2020 23:51:21 +0200	[thread overview]
Message-ID: <20200825235121.0d8bd3d0@elisabeth> (raw)
In-Reply-To: <20200825050636.14153-2-xiangxia.m.yue@gmail.com>

On Tue, 25 Aug 2020 13:06:34 +0800
xiangxia.m.yue@gmail.com wrote:

> +++ b/net/openvswitch/datapath.c
>
> [...]
>
> @@ -2095,7 +2099,7 @@ static void ovs_update_headroom(struct datapath *dp, unsigned int new_headroom)
>  	dp->max_headroom = new_headroom;
>  	for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++)

While at it, you could also add curly brackets here.

> +++ b/net/openvswitch/flow_table.c
>
> [...]
>
> @@ -111,9 +111,11 @@ static void flow_free(struct sw_flow *flow)
>  	if (ovs_identifier_is_key(&flow->id))
>  		kfree(flow->id.unmasked_key);
>  	if (flow->sf_acts)
> -		ovs_nla_free_flow_actions((struct sw_flow_actions __force *)flow->sf_acts);
> +		ovs_nla_free_flow_actions((struct sw_flow_actions __force *)
> +					  flow->sf_acts);
>  	/* We open code this to make sure cpu 0 is always considered */
> -	for (cpu = 0; cpu < nr_cpu_ids; cpu = cpumask_next(cpu, &flow->cpu_used_mask))
> +	for (cpu = 0; cpu < nr_cpu_ids;
> +	     cpu = cpumask_next(cpu, &flow->cpu_used_mask))

...and here.

> @@ -273,7 +275,7 @@ static int tbl_mask_array_add_mask(struct flow_table *tbl,
>  
>  	if (ma_count >= ma->max) {
>  		err = tbl_mask_array_realloc(tbl, ma->max +
> -					      MASK_ARRAY_SIZE_MIN);
> +					     MASK_ARRAY_SIZE_MIN);

This is not aligned properly either, MASK_ARRAY_SIZE_MIN is added to
ma->max and should be aligned to it.

> @@ -448,16 +450,17 @@ int ovs_flow_tbl_init(struct flow_table *table)
>  
>  static void flow_tbl_destroy_rcu_cb(struct rcu_head *rcu)
>  {
> -	struct table_instance *ti = container_of(rcu, struct table_instance, rcu);
> +	struct table_instance *ti =
> +		container_of(rcu, struct table_instance, rcu);

The assignment could very well go on a separate line.

-- 
Stefano


  reply	other threads:[~2020-08-25 21:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25  5:06 [PATCH net-next v3 0/3] net: openvswitch: improve codes xiangxia.m.yue
2020-08-25  5:06 ` [PATCH net-next v3 1/3] net: openvswitch: improve coding style xiangxia.m.yue
2020-08-25 21:51   ` Stefano Brivio [this message]
2020-09-01 11:54     ` Tonghao Zhang
2020-08-25  5:06 ` [PATCH net-next v3 2/3] net: openvswitch: refactor flow free function xiangxia.m.yue
2020-08-26 19:23   ` Pravin Shelar
2020-08-25  5:06 ` [PATCH net-next v3 3/3] net: openvswitch: remove unnused keep_flows xiangxia.m.yue
2020-08-26 19:23   ` Pravin Shelar
2020-08-25 16:37 ` [PATCH net-next v3 0/3] net: openvswitch: improve codes David Miller
2020-08-26  7:09   ` Pravin Shelar

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=20200825235121.0d8bd3d0@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.org \
    --cc=xiangxia.m.yue@gmail.com \
    --cc=xiyou.wangcong@gmail.com \
    --subject='Re: [PATCH net-next v3 1/3] net: openvswitch: improve coding style' \
    /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

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).