lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 25 Aug 2020 23:51:21 +0200
From:   Stefano Brivio <sbrivio@...hat.com>
To:     xiangxia.m.yue@...il.com
Cc:     davem@...emloft.net, pshelar@....org, xiyou.wangcong@...il.com,
        dev@...nvswitch.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v3 1/3] net: openvswitch: improve coding style

On Tue, 25 Aug 2020 13:06:34 +0800
xiangxia.m.yue@...il.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

Powered by blists - more mailing lists