netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] xfrm: policy: remove set but not used variable 'priority'
@ 2018-12-19  1:12 YueHaibing
  2018-12-19  9:13 ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2018-12-19  1:12 UTC (permalink / raw)
  To: Steffen Klassert, Herbert Xu; +Cc: YueHaibing, netdev, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

net/xfrm/xfrm_policy.c: In function 'xfrm_policy_lookup_bytype':
net/xfrm/xfrm_policy.c:2079:6: warning:
 variable 'priority' set but not used [-Wunused-but-set-variable]

It not used since commit 6be3b0db6db8 ("xfrm: policy: add inexact policy
search tree infrastructure")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/xfrm/xfrm_policy.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index be04091..537b7ee 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2076,7 +2076,6 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
 	struct xfrm_policy *pol, *ret;
 	struct hlist_head *chain;
 	unsigned int sequence;
-	u32 priority;
 	int err;
 
 	daddr = xfrm_flowi_daddr(fl, family);
@@ -2091,7 +2090,6 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
 		chain = policy_hash_direct(net, daddr, saddr, family, dir);
 	} while (read_seqcount_retry(&xfrm_policy_hash_generation, sequence));
 
-	priority = ~0U;
 	ret = NULL;
 	hlist_for_each_entry_rcu(pol, chain, bydst) {
 		err = xfrm_policy_match(pol, fl, type, family, dir, if_id);
@@ -2104,7 +2102,6 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
 			}
 		} else {
 			ret = pol;
-			priority = ret->priority;
 			break;
 		}
 	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] xfrm: policy: remove set but not used variable 'priority'
  2018-12-19  1:12 [PATCH net-next] xfrm: policy: remove set but not used variable 'priority' YueHaibing
@ 2018-12-19  9:13 ` Florian Westphal
  2018-12-20  8:10   ` Steffen Klassert
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2018-12-19  9:13 UTC (permalink / raw)
  To: YueHaibing; +Cc: Steffen Klassert, Herbert Xu, netdev, kernel-janitors

YueHaibing <yuehaibing@huawei.com> wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> net/xfrm/xfrm_policy.c: In function 'xfrm_policy_lookup_bytype':
> net/xfrm/xfrm_policy.c:2079:6: warning:
>  variable 'priority' set but not used [-Wunused-but-set-variable]
> 
> It not used since commit 6be3b0db6db8 ("xfrm: policy: add inexact policy
> search tree infrastructure")

Acked-by: Florian Westphal <fw@strlen.de>

Removing this appears correct, the exact policy gets passed to
xfrm_policy_eval_candidates where the priority is checked.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] xfrm: policy: remove set but not used variable 'priority'
  2018-12-19  9:13 ` Florian Westphal
@ 2018-12-20  8:10   ` Steffen Klassert
  0 siblings, 0 replies; 3+ messages in thread
From: Steffen Klassert @ 2018-12-20  8:10 UTC (permalink / raw)
  To: Florian Westphal; +Cc: YueHaibing, Herbert Xu, netdev, kernel-janitors

On Wed, Dec 19, 2018 at 10:13:13AM +0100, Florian Westphal wrote:
> YueHaibing <yuehaibing@huawei.com> wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> > 
> > net/xfrm/xfrm_policy.c: In function 'xfrm_policy_lookup_bytype':
> > net/xfrm/xfrm_policy.c:2079:6: warning:
> >  variable 'priority' set but not used [-Wunused-but-set-variable]
> > 
> > It not used since commit 6be3b0db6db8 ("xfrm: policy: add inexact policy
> > search tree infrastructure")
> 
> Acked-by: Florian Westphal <fw@strlen.de>

Patch applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-20  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-19  1:12 [PATCH net-next] xfrm: policy: remove set but not used variable 'priority' YueHaibing
2018-12-19  9:13 ` Florian Westphal
2018-12-20  8:10   ` Steffen Klassert

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