On Tue, 07 Jul 2020 02:08:13 +0800
"YU, Xiangning" <[email protected]> wrote:

> +static inline int ltb_drain(struct ltb_class *cl)
> +{
> +     typeof(&cl->drain_queue) queue;
> +     struct sk_buff *skb;
> +     int npkts, bytes;
> +     unsigned long now = NOW();
> +     int cpu;
> +     struct ltb_sched *ltb = qdisc_priv(cl->root_qdisc);
> +     struct ltb_pcpu_sched *pcpu_q;
> +     s64 timestamp;
> +     bool need_watchdog = false;
> +     struct cpumask cpumask;
> +
> +     npkts = 0;
> +     bytes = 0;

It would be safer to use unsigned int for npkts and bytes.
These should never be negative.

Reply via email to