netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/sched: act_police: re-use tcf_tm_dump()
@ 2019-10-19 16:49 Davide Caratti
  2019-10-19 19:18 ` Jiri Pirko
  2019-10-21 18:23 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Davide Caratti @ 2019-10-19 16:49 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

Use tcf_tm_dump(), instead of an open coded variant (no functional change
in this patch).

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
---
 net/sched/act_police.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 89c04c52af3d..981a9eca0c52 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -345,10 +345,7 @@ static int tcf_police_dump(struct sk_buff *skb, struct tc_action *a,
 	    nla_put_u32(skb, TCA_POLICE_AVRATE, p->tcfp_ewma_rate))
 		goto nla_put_failure;
 
-	t.install = jiffies_to_clock_t(jiffies - police->tcf_tm.install);
-	t.lastuse = jiffies_to_clock_t(jiffies - police->tcf_tm.lastuse);
-	t.firstuse = jiffies_to_clock_t(jiffies - police->tcf_tm.firstuse);
-	t.expires = jiffies_to_clock_t(police->tcf_tm.expires);
+	tcf_tm_dump(&t, &police->tcf_tm);
 	if (nla_put_64bit(skb, TCA_POLICE_TM, sizeof(t), &t, TCA_POLICE_PAD))
 		goto nla_put_failure;
 	spin_unlock_bh(&police->tcf_lock);
-- 
2.21.0


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

* Re: [PATCH net-next] net/sched: act_police: re-use tcf_tm_dump()
  2019-10-19 16:49 [PATCH net-next] net/sched: act_police: re-use tcf_tm_dump() Davide Caratti
@ 2019-10-19 19:18 ` Jiri Pirko
  2019-10-21 18:23 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2019-10-19 19:18 UTC (permalink / raw)
  To: Davide Caratti; +Cc: David S. Miller, netdev

Sat, Oct 19, 2019 at 06:49:32PM CEST, dcaratti@redhat.com wrote:
>Use tcf_tm_dump(), instead of an open coded variant (no functional change
>in this patch).
>
>Signed-off-by: Davide Caratti <dcaratti@redhat.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

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

* Re: [PATCH net-next] net/sched: act_police: re-use tcf_tm_dump()
  2019-10-19 16:49 [PATCH net-next] net/sched: act_police: re-use tcf_tm_dump() Davide Caratti
  2019-10-19 19:18 ` Jiri Pirko
@ 2019-10-21 18:23 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-10-21 18:23 UTC (permalink / raw)
  To: dcaratti; +Cc: netdev

From: Davide Caratti <dcaratti@redhat.com>
Date: Sat, 19 Oct 2019 18:49:32 +0200

> Use tcf_tm_dump(), instead of an open coded variant (no functional change
> in this patch).
> 
> Signed-off-by: Davide Caratti <dcaratti@redhat.com>

Applied.

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

end of thread, other threads:[~2019-10-21 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-19 16:49 [PATCH net-next] net/sched: act_police: re-use tcf_tm_dump() Davide Caratti
2019-10-19 19:18 ` Jiri Pirko
2019-10-21 18:23 ` David Miller

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