ipv4: remove unnecessary type castings
authorYu Zhe <yuzhe@nfschina.com>
Fri, 29 Apr 2022 02:14:04 +0000 (19:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Apr 2022 14:12:58 +0000 (15:12 +0100)
remove unnecessary void* type castings.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_frontend.c
net/ipv4/fib_rules.c
net/ipv4/fib_trie.c
net/ipv4/icmp.c
net/ipv4/igmp.c
net/ipv4/inet_fragment.c
net/ipv4/ipmr.c
net/ipv4/ping.c

index af8209f912ab37738a1b31e369edd12a5ea1527f..f361d3d56be27591b548b088a44d995d9aa38bbf 100644 (file)
@@ -1384,7 +1384,7 @@ static void nl_fib_input(struct sk_buff *skb)
                return;
        nlh = nlmsg_hdr(skb);
 
-       frn = (struct fib_result_nl *) nlmsg_data(nlh);
+       frn = nlmsg_data(nlh);
        nl_fib_lookup(net, frn);
 
        portid = NETLINK_CB(skb).portid;      /* netlink portid */
@@ -1425,7 +1425,7 @@ static void fib_disable_ip(struct net_device *dev, unsigned long event,
 
 static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
-       struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
+       struct in_ifaddr *ifa = ptr;
        struct net_device *dev = ifa->ifa_dev->dev;
        struct net *net = dev_net(dev);
 
index 001fea394bde96cbffc02a1504d83e979f78781b..513f475c6a534e0fb406b93525476ac9c03f3bc8 100644 (file)
@@ -145,7 +145,7 @@ INDIRECT_CALLABLE_SCOPE bool fib4_rule_suppress(struct fib_rule *rule,
                                                int flags,
                                                struct fib_lookup_arg *arg)
 {
-       struct fib_result *result = (struct fib_result *) arg->result;
+       struct fib_result *result = arg->result;
        struct net_device *dev = NULL;
 
        if (result->fi) {
index 1f7f25532fa1056d6a02251cbd9f8a64d0ed590d..2734c3af7e2454fe8d57f5171071ae5afe795eda 100644 (file)
@@ -2625,7 +2625,7 @@ static void fib_table_print(struct seq_file *seq, struct fib_table *tb)
 
 static int fib_triestat_seq_show(struct seq_file *seq, void *v)
 {
-       struct net *net = (struct net *)seq->private;
+       struct net *net = seq->private;
        unsigned int h;
 
        seq_printf(seq,
index 236debd9fded1481cd15df8fdc6f487682640e71..efea0e796f064d21fdb5854070c878581427fcb6 100644 (file)
@@ -342,7 +342,7 @@ void icmp_out_count(struct net *net, unsigned char type)
 static int icmp_glue_bits(void *from, char *to, int offset, int len, int odd,
                          struct sk_buff *skb)
 {
-       struct icmp_bxm *icmp_param = (struct icmp_bxm *)from;
+       struct icmp_bxm *icmp_param = from;
        __wsum csum;
 
        csum = skb_copy_and_csum_bits(icmp_param->skb,
index 2ad3c7b42d6d271baf941e7f74feaf981dff8036..1ba8ebc439f303274c0e5334a83940340d35f89e 100644 (file)
@@ -2836,7 +2836,7 @@ static int igmp_mc_seq_show(struct seq_file *seq, void *v)
                seq_puts(seq,
                         "Idx\tDevice    : Count Querier\tGroup    Users Timer\tReporter\n");
        else {
-               struct ip_mc_list *im = (struct ip_mc_list *)v;
+               struct ip_mc_list *im = v;
                struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
                char   *querier;
                long delta;
@@ -2980,7 +2980,7 @@ static void igmp_mcf_seq_stop(struct seq_file *seq, void *v)
 
 static int igmp_mcf_seq_show(struct seq_file *seq, void *v)
 {
-       struct ip_sf_list *psf = (struct ip_sf_list *)v;
+       struct ip_sf_list *psf = v;
        struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq);
 
        if (v == SEQ_START_TOKEN) {
index 63948f6aeca0ecb6211e88d037ca88d5c8172b93..c9f9ac5013a717ddbc403c7317aaa228b09f6a0c 100644 (file)
@@ -510,7 +510,7 @@ EXPORT_SYMBOL(inet_frag_reasm_prepare);
 void inet_frag_reasm_finish(struct inet_frag_queue *q, struct sk_buff *head,
                            void *reasm_data, bool try_coalesce)
 {
-       struct sk_buff **nextp = (struct sk_buff **)reasm_data;
+       struct sk_buff **nextp = reasm_data;
        struct rb_node *rbn;
        struct sk_buff *fp;
        int sum_truesize;
index c860519d57ee52461e3f7452da4c960ba792b5bc..13e6329784fb5def8dea594a87c397bbdc3f26bd 100644 (file)
@@ -356,7 +356,7 @@ static inline int ipmr_hash_cmp(struct rhashtable_compare_arg *arg,
                                const void *ptr)
 {
        const struct mfc_cache_cmp_arg *cmparg = arg->key;
-       struct mfc_cache *c = (struct mfc_cache *)ptr;
+       const struct mfc_cache *c = ptr;
 
        return cmparg->mfc_mcastgrp != c->mfc_mcastgrp ||
               cmparg->mfc_origin != c->mfc_origin;
index 319c181bfbb6628667bbf71f74416912cac789bf..5f8cad2978b352504069a5ad2223c1fb4edb30a7 100644 (file)
@@ -590,7 +590,7 @@ EXPORT_SYMBOL_GPL(ping_err);
 int ping_getfrag(void *from, char *to,
                 int offset, int fraglen, int odd, struct sk_buff *skb)
 {
-       struct pingfakehdr *pfh = (struct pingfakehdr *)from;
+       struct pingfakehdr *pfh = from;
 
        if (offset == 0) {
                fraglen -= sizeof(struct icmphdr);