diff options
| author | Andre Guedes <andre.guedes@intel.com> | 2019-04-23 15:44:22 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2019-04-23 22:52:32 -0400 |
| commit | 5175aafe71bfb3fc6a1254a966b0f60e7a46ebba (patch) | |
| tree | 95b5745d712ef5ab29fa40a93bc7f1fc0b74d716 /net/sched | |
| parent | 8599099f0c58cec677a47c968e777eee8d64fb80 (diff) | |
net: sched: taprio: Remove should_restart_cycle()
The 'entry' argument from should_restart_cycle() cannot be NULL since it
is already checked by the caller so the WARN_ON() within should_
restart_cycle() could be removed. By doing that, that function becomes
a dummy wrapper on list_is_last() so this patch simply gets rid of it
and call list_is_last() within advance_sched() instead.
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
| -rw-r--r-- | net/sched/sch_taprio.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index d0aae7b5e608..77cca993710a 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c | |||
| @@ -209,14 +209,6 @@ static struct sk_buff *taprio_dequeue(struct Qdisc *sch) | |||
| 209 | return NULL; | 209 | return NULL; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | static bool should_restart_cycle(const struct taprio_sched *q, | ||
| 213 | const struct sched_entry *entry) | ||
| 214 | { | ||
| 215 | WARN_ON(!entry); | ||
| 216 | |||
| 217 | return list_is_last(&entry->list, &q->entries); | ||
| 218 | } | ||
| 219 | |||
| 220 | static enum hrtimer_restart advance_sched(struct hrtimer *timer) | 212 | static enum hrtimer_restart advance_sched(struct hrtimer *timer) |
| 221 | { | 213 | { |
| 222 | struct taprio_sched *q = container_of(timer, struct taprio_sched, | 214 | struct taprio_sched *q = container_of(timer, struct taprio_sched, |
| @@ -240,7 +232,7 @@ static enum hrtimer_restart advance_sched(struct hrtimer *timer) | |||
| 240 | goto first_run; | 232 | goto first_run; |
| 241 | } | 233 | } |
| 242 | 234 | ||
| 243 | if (should_restart_cycle(q, entry)) | 235 | if (list_is_last(&entry->list, &q->entries)) |
| 244 | next = list_first_entry(&q->entries, struct sched_entry, | 236 | next = list_first_entry(&q->entries, struct sched_entry, |
| 245 | list); | 237 | list); |
| 246 | else | 238 | else |
