[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200821.114115.118706831249226561.davem@davemloft.net>
Date: Fri, 21 Aug 2020 11:41:15 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: Jianlin.Lv@....com
Cc: netdev@...r.kernel.org, kuba@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: remove redundant variable in
vxlan_xmit_one
From: Jianlin Lv <Jianlin.Lv@....com>
Date: Fri, 21 Aug 2020 13:56:36 +0800
> @@ -2614,8 +2613,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
> info = skb_tunnel_info(skb);
>
> if (rdst) {
> - dst = &rdst->remote_ip;
> - if (vxlan_addr_any(dst)) {
> + remote_ip = rdst->remote_ip;
> + if (vxlan_addr_any(&remote_ip)) {
> if (did_rsc) {
Now we are making a copy of the remote_ip object on the stack, and
passing a reference to the stack copy to the vxlan_addr_any()
function. The existing code is passing a reference to the
original object, no copies.
This is not an improvement.
Powered by blists - more mailing lists