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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b09fae8a2ac505b302047cbb5a17be05d7da3302.camel@nvidia.com>
Date:   Tue, 16 Nov 2021 20:56:33 +0000
From:   Saeed Mahameed <saeedm@...dia.com>
To:     "davidcomponentone@...il.com" <davidcomponentone@...il.com>
CC:     "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        "zealci@....com.cn" <zealci@....com.cn>,
        "davem@...emloft.net" <davem@...emloft.net>,
        Roi Dayan <roid@...dia.com>,
        Ariel Levkovich <lariel@...dia.com>,
        Paul Blakey <paulb@...dia.com>,
        Vlad Buslov <vladbu@...dia.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Chris Mi <cmi@...dia.com>, "kuba@...nel.org" <kuba@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "leon@...nel.org" <leon@...nel.org>, Oz Shlomo <ozsh@...dia.com>,
        "yang.guang5@....com.cn" <yang.guang5@....com.cn>
Subject: Re: [PATCH] net/mlx5: use swap() to make code cleaner

On Thu, 2021-11-04 at 09:17 +0800, davidcomponentone@...il.com wrote:
> From: Yang Guang <yang.guang5@....com.cn>
> 
> Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
> opencoding it.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Yang Guang <yang.guang5@....com.cn>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
> b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
> index c1c6e74c79c4..8ce4b6112169 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
> @@ -907,12 +907,9 @@ mlx5_tc_ct_shared_counter_get(struct
> mlx5_tc_ct_priv *ct_priv,
>         struct mlx5_ct_tuple rev_tuple = entry->tuple;
>         struct mlx5_ct_counter *shared_counter;
>         struct mlx5_ct_entry *rev_entry;
> -       __be16 tmp_port;
>  
>         /* get the reversed tuple */
> -       tmp_port = rev_tuple.port.src;
> -       rev_tuple.port.src = rev_tuple.port.dst;
> -       rev_tuple.port.dst = tmp_port;
> +       swap(rev_tuple.port.src, rev_tuple.port.dst);
>  
>         if (rev_tuple.addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {
>                 __be32 tmp_addr = rev_tuple.ip.src_v4;

An identical patch was already submitted the day before.
Thanks for the effort !

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ