All the bind_class callback duplicate the same logic, so we can refactor them. First, ensure n arg not empty before call bind_class hook function. Then, add tc_cls_bind_class() helper. Last, use tc_cls_bind_class() in filter. Zhengchao Shao (3): net: sched: ensure n arg not empty before call bind_class net: sched: cls_api: introduce tc_cls_bind_class() helper net: sched: use tc_cls_bind_class() in filter include/net/pkt_cls.h | 12 ++++++++++++ net/sched/cls_basic.c | 7 +------ net/sched/cls_bpf.c | 7 +------ net/sched/cls_flower.c | 7 +------ net/sched/cls_fw.c | 7 +------ net/sched/cls_matchall.c | 7 +------ net/sched/cls_route.c | 7 +------ net/sched/cls_rsvp.h | 7 +------ net/sched/cls_tcindex.c | 7 +------ net/sched/cls_u32.c | 7 +------ net/sched/sch_api.c | 2 +- 11 files changed, 22 insertions(+), 55 deletions(-) -- 2.17.1