tp->root is a void* pointer, no need to cast it.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
                          struct tcf_result *res)
 {
        int r;
-       struct basic_head *head = (struct basic_head *) tp->root;
+       struct basic_head *head = tp->root;
        struct basic_filter *f;
 
        list_for_each_entry(f, &head->flist, link) {
 static unsigned long basic_get(struct tcf_proto *tp, u32 handle)
 {
        unsigned long l = 0UL;
-       struct basic_head *head = (struct basic_head *) tp->root;
+       struct basic_head *head = tp->root;
        struct basic_filter *f;
 
        if (head == NULL)
 
 static int basic_delete(struct tcf_proto *tp, unsigned long arg)
 {
-       struct basic_head *head = (struct basic_head *) tp->root;
+       struct basic_head *head = tp->root;
        struct basic_filter *t, *f = (struct basic_filter *) arg;
 
        list_for_each_entry(t, &head->flist, link)
                        struct nlattr **tca, unsigned long *arg)
 {
        int err;
-       struct basic_head *head = (struct basic_head *) tp->root;
+       struct basic_head *head = tp->root;
        struct nlattr *tb[TCA_BASIC_MAX + 1];
        struct basic_filter *f = (struct basic_filter *) *arg;
 
 
 static void basic_walk(struct tcf_proto *tp, struct tcf_walker *arg)
 {
-       struct basic_head *head = (struct basic_head *) tp->root;
+       struct basic_head *head = tp->root;
        struct basic_filter *f;
 
        list_for_each_entry(f, &head->flist, link) {
 
 static int fw_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                          struct tcf_result *res)
 {
-       struct fw_head *head = (struct fw_head *)tp->root;
+       struct fw_head *head = tp->root;
        struct fw_filter *f;
        int r;
        u32 id = skb->mark;
 
 static unsigned long fw_get(struct tcf_proto *tp, u32 handle)
 {
-       struct fw_head *head = (struct fw_head *)tp->root;
+       struct fw_head *head = tp->root;
        struct fw_filter *f;
 
        if (head == NULL)
 
 static int fw_delete(struct tcf_proto *tp, unsigned long arg)
 {
-       struct fw_head *head = (struct fw_head *)tp->root;
+       struct fw_head *head = tp->root;
        struct fw_filter *f = (struct fw_filter *)arg;
        struct fw_filter **fp;
 
 fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f,
        struct nlattr **tb, struct nlattr **tca, unsigned long base)
 {
-       struct fw_head *head = (struct fw_head *)tp->root;
+       struct fw_head *head = tp->root;
        struct tcf_exts e;
        u32 mask;
        int err;
                     struct nlattr **tca,
                     unsigned long *arg)
 {
-       struct fw_head *head = (struct fw_head *)tp->root;
+       struct fw_head *head = tp->root;
        struct fw_filter *f = (struct fw_filter *) *arg;
        struct nlattr *opt = tca[TCA_OPTIONS];
        struct nlattr *tb[TCA_FW_MAX + 1];
 
 static void fw_walk(struct tcf_proto *tp, struct tcf_walker *arg)
 {
-       struct fw_head *head = (struct fw_head *)tp->root;
+       struct fw_head *head = tp->root;
        int h;
 
        if (head == NULL)
 static int fw_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
                   struct sk_buff *skb, struct tcmsg *t)
 {
-       struct fw_head *head = (struct fw_head *)tp->root;
+       struct fw_head *head = tp->root;
        struct fw_filter *f = (struct fw_filter *)fh;
        unsigned char *b = skb_tail_pointer(skb);
        struct nlattr *nest;
 
 static int route4_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                           struct tcf_result *res)
 {
-       struct route4_head *head = (struct route4_head *)tp->root;
+       struct route4_head *head = tp->root;
        struct dst_entry *dst;
        struct route4_bucket *b;
        struct route4_filter *f;
 
 static unsigned long route4_get(struct tcf_proto *tp, u32 handle)
 {
-       struct route4_head *head = (struct route4_head *)tp->root;
+       struct route4_head *head = tp->root;
        struct route4_bucket *b;
        struct route4_filter *f;
        unsigned int h1, h2;
 
 static int route4_delete(struct tcf_proto *tp, unsigned long arg)
 {
-       struct route4_head *head = (struct route4_head *)tp->root;
+       struct route4_head *head = tp->root;
        struct route4_filter **fp, *f = (struct route4_filter *)arg;
        unsigned int h = 0;
        struct route4_bucket *b;
 
 #define DEFAULT_HASH_SIZE      64      /* optimized for diffserv */
 
 
-#define        PRIV(tp)        ((struct tcindex_data *) (tp)->root)
-
-
 struct tcindex_filter_result {
        struct tcf_exts         exts;
        struct tcf_result       res;
 static int tcindex_classify(struct sk_buff *skb, const struct tcf_proto *tp,
                            struct tcf_result *res)
 {
-       struct tcindex_data *p = PRIV(tp);
+       struct tcindex_data *p = tp->root;
        struct tcindex_filter_result *f;
        int key = (skb->tc_index & p->mask) >> p->shift;
 
 
 static unsigned long tcindex_get(struct tcf_proto *tp, u32 handle)
 {
-       struct tcindex_data *p = PRIV(tp);
+       struct tcindex_data *p = tp->root;
        struct tcindex_filter_result *r;
 
        pr_debug("tcindex_get(tp %p,handle 0x%08x)\n", tp, handle);
 static int
 __tcindex_delete(struct tcf_proto *tp, unsigned long arg, int lock)
 {
-       struct tcindex_data *p = PRIV(tp);
+       struct tcindex_data *p = tp->root;
        struct tcindex_filter_result *r = (struct tcindex_filter_result *) arg;
        struct tcindex_filter *f = NULL;
 
 {
        struct nlattr *opt = tca[TCA_OPTIONS];
        struct nlattr *tb[TCA_TCINDEX_MAX + 1];
-       struct tcindex_data *p = PRIV(tp);
+       struct tcindex_data *p = tp->root;
        struct tcindex_filter_result *r = (struct tcindex_filter_result *) *arg;
        int err;
 
 
 static void tcindex_walk(struct tcf_proto *tp, struct tcf_walker *walker)
 {
-       struct tcindex_data *p = PRIV(tp);
+       struct tcindex_data *p = tp->root;
        struct tcindex_filter *f, *next;
        int i;
 
 
 static void tcindex_destroy(struct tcf_proto *tp)
 {
-       struct tcindex_data *p = PRIV(tp);
+       struct tcindex_data *p = tp->root;
        struct tcf_walker walker;
 
        pr_debug("tcindex_destroy(tp %p),p %p\n", tp, p);
 static int tcindex_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
     struct sk_buff *skb, struct tcmsg *t)
 {
-       struct tcindex_data *p = PRIV(tp);
+       struct tcindex_data *p = tp->root;
        struct tcindex_filter_result *r = (struct tcindex_filter_result *) fh;
        unsigned char *b = skb_tail_pointer(skb);
        struct nlattr *nest;
 
                unsigned int      off;
        } stack[TC_U32_MAXDEPTH];
 
-       struct tc_u_hnode *ht = (struct tc_u_hnode *)tp->root;
+       struct tc_u_hnode *ht = tp->root;
        unsigned int off = skb_network_offset(skb);
        struct tc_u_knode *n;
        int sdepth = 0;