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  linux-cve-announce  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]
Message-ID: <B4FCA95A-F6E0-4610-8671-780A2015C5F4@redhat.com>
Date: Mon, 26 Aug 2024 08:37:44 +0200
From: Eelco Chaudron <echaudro@...hat.com>
To: Hongbo Li <lihongbo22@...wei.com>
Cc: johannes@...solutions.net, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org, pabeni@...hat.com, allison.henderson@...cle.com,
 dsahern@...nel.org, pshelar@....org, linux-wireless@...r.kernel.org,
 netdev@...r.kernel.org, rds-devel@....oracle.com, dccp@...r.kernel.org,
 dev@...nvswitch.org, linux-afs@...ts.infradead.org
Subject: Re: [PATCH net-next 6/8] net/openvswitch: Use max() to simplify the
 code



On 24 Aug 2024, at 9:40, Hongbo Li wrote:

> Let's use max() to simplify the code and fix the
> Coccinelle/coccicheck warning reported by minmax.cocci.
>
> Signed-off-by: Hongbo Li <lihongbo22@...wei.com>

The change looks good to me.

Acked-by: Eelco Chaudron <echaudro@...hat.com>
> ---
>  net/openvswitch/vport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
> index 8732f6e51ae5..859208df65ea 100644
> --- a/net/openvswitch/vport.c
> +++ b/net/openvswitch/vport.c
> @@ -534,7 +534,7 @@ static int packet_length(const struct sk_buff *skb,
>  	 * account for 802.1ad. e.g. is_skb_forwardable().
>  	 */
>
> -	return length > 0 ? length : 0;
> +	return max(length, 0);
>  }
>
>  void ovs_vport_send(struct vport *vport, struct sk_buff *skb, u8 mac_proto)
> -- 
> 2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ