struct fq_flow *aux;
 
                parent = *p;
-               aux = container_of(parent, struct fq_flow, rate_node);
+               aux = rb_entry(parent, struct fq_flow, rate_node);
                if (f->time_next_packet >= aux->time_next_packet)
                        p = &parent->rb_right;
                else
        while (*p) {
                parent = *p;
 
-               f = container_of(parent, struct fq_flow, fq_node);
+               f = rb_entry(parent, struct fq_flow, fq_node);
                if (f->sk == sk)
                        break;
 
        while (*p) {
                parent = *p;
 
-               f = container_of(parent, struct fq_flow, fq_node);
+               f = rb_entry(parent, struct fq_flow, fq_node);
                if (f->sk == sk) {
                        /* socket might have been reallocated, so check
                         * if its sk_hash is the same.
 
        q->time_next_delayed_flow = ~0ULL;
        while ((p = rb_first(&q->delayed)) != NULL) {
-               struct fq_flow *f = container_of(p, struct fq_flow, rate_node);
+               struct fq_flow *f = rb_entry(p, struct fq_flow, rate_node);
 
                if (f->time_next_packet > now) {
                        q->time_next_delayed_flow = f->time_next_packet;
        for (idx = 0; idx < (1U << q->fq_trees_log); idx++) {
                root = &q->fq_root[idx];
                while ((p = rb_first(root)) != NULL) {
-                       f = container_of(p, struct fq_flow, fq_node);
+                       f = rb_entry(p, struct fq_flow, fq_node);
                        rb_erase(p, root);
 
                        fq_flow_purge(f);
                oroot = &old_array[idx];
                while ((op = rb_first(oroot)) != NULL) {
                        rb_erase(op, oroot);
-                       of = container_of(op, struct fq_flow, fq_node);
+                       of = rb_entry(op, struct fq_flow, fq_node);
                        if (fq_gc_candidate(of)) {
                                fcnt++;
                                kmem_cache_free(fq_flow_cachep, of);
                        while (*np) {
                                parent = *np;
 
-                               nf = container_of(parent, struct fq_flow, fq_node);
+                               nf = rb_entry(parent, struct fq_flow, fq_node);
                                BUG_ON(nf->sk == of->sk);
 
                                if (nf->sk > of->sk)