kernel_buf = 1;
                        indata = data;
                } else
-                       indata = (char *)udata;
+                       indata = udata;
                /*
                 * response header len is 11
                 * PDU Header(7) + IO Size (4)
 
 {
        unsigned long flags;
        struct lec_arp_table *to_remove = (struct lec_arp_table *)data;
-       struct lec_priv *priv = (struct lec_priv *)to_remove->priv;
+       struct lec_priv *priv = to_remove->priv;
 
        del_timer(&to_remove->timer);
 
 
        /* Set "cross subchannel" bit in ackcrs */
        ackcrs |= 0x2000;
 
-       ptr = (__le16 *)dn_mk_common_header(scp, skb, msgflag, hlen);
+       ptr = dn_mk_common_header(scp, skb, msgflag, hlen);
 
        *ptr++ = cpu_to_le16(acknum);
        *ptr++ = cpu_to_le16(ackcrs);
 
 
        if (!inet_sk(sk)->inet_num && inet_autobind(sk))
                return -EAGAIN;
-       return sk->sk_prot->connect(sk, (struct sockaddr *)uaddr, addr_len);
+       return sk->sk_prot->connect(sk, uaddr, addr_len);
 }
 EXPORT_SYMBOL(inet_dgram_connect);
 
 
        while (tn != NULL && (tp = node_parent((struct rt_trie_node *)tn)) != NULL) {
                cindex = tkey_extract_bits(key, tp->pos, tp->bits);
                wasfull = tnode_full(tp, tnode_get_child(tp, cindex));
-               tn = (struct tnode *) resize(t, (struct tnode *)tn);
+               tn = (struct tnode *)resize(t, tn);
 
-               tnode_put_child_reorg((struct tnode *)tp, cindex,
+               tnode_put_child_reorg(tp, cindex,
                                      (struct rt_trie_node *)tn, wasfull);
 
                tp = node_parent((struct rt_trie_node *) tn);
 
        /* Handle last (top) tnode */
        if (IS_TNODE(tn))
-               tn = (struct tnode *)resize(t, (struct tnode *)tn);
+               tn = (struct tnode *)resize(t, tn);
 
        rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
        tnode_free_flush();
                node_set_parent((struct rt_trie_node *)l, tp);
 
                cindex = tkey_extract_bits(key, tp->pos, tp->bits);
-               put_child(t, (struct tnode *)tp, cindex, (struct rt_trie_node *)l);
+               put_child(t, tp, cindex, (struct rt_trie_node *)l);
        } else {
                /* Case 3: n is a LEAF or a TNODE and the key doesn't match. */
                /*
 
                if (tp) {
                        cindex = tkey_extract_bits(key, tp->pos, tp->bits);
-                       put_child(t, (struct tnode *)tp, cindex,
-                                 (struct rt_trie_node *)tn);
+                       put_child(t, tp, cindex, (struct rt_trie_node *)tn);
                } else {
                        rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
                        tp = tn;
 
        if (tp) {
                t_key cindex = tkey_extract_bits(l->key, tp->pos, tp->bits);
-               put_child(t, (struct tnode *)tp, cindex, NULL);
+               put_child(t, tp, cindex, NULL);
                trie_rebalance(t, tp);
        } else
                RCU_INIT_POINTER(t->trie, NULL);
 
 
        ptr = *octets;
        while (ctx->pointer < eoc) {
-               if (!asn1_octet_decode(ctx, (unsigned char *)ptr++)) {
+               if (!asn1_octet_decode(ctx, ptr++)) {
                        kfree(*octets);
                        *octets = NULL;
                        return 0;
                }
                break;
        case SNMP_OBJECTID:
-               if (!asn1_oid_decode(ctx, end, (unsigned long **)&lp, &len)) {
+               if (!asn1_oid_decode(ctx, end, &lp, &len)) {
                        kfree(id);
                        return 0;
                }
 
                if (ohdr) {
                        memcpy(*p, ohdr, ipv6_optlen((struct ipv6_opt_hdr *)ohdr));
                        *hdr = (struct ipv6_opt_hdr *)*p;
-                       *p += CMSG_ALIGN(ipv6_optlen(*(struct ipv6_opt_hdr **)hdr));
+                       *p += CMSG_ALIGN(ipv6_optlen(*hdr));
                }
        } else {
                if (newopt) {
                        if (copy_from_user(*p, newopt, newoptlen))
                                return -EFAULT;
                        *hdr = (struct ipv6_opt_hdr *)*p;
-                       if (ipv6_optlen(*(struct ipv6_opt_hdr **)hdr) > newoptlen)
+                       if (ipv6_optlen(*hdr) > newoptlen)
                                return -EINVAL;
                        *p += CMSG_ALIGN(newoptlen);
                }
 
                 * Dequeue the entry...
                 */
                dequeue_general( (irda_queue_t**) &hashbin->hb_queue[ bin ],
-                                (irda_queue_t*) entry );
+                                entry);
                hashbin->hb_size--;
                entry->q_next = NULL;
                entry->q_prev = NULL;
         */
        if ( found ) {
                dequeue_general( (irda_queue_t**) &hashbin->hb_queue[ bin ],
-                                (irda_queue_t*) entry );
+                                entry);
                hashbin->hb_size--;
 
                /*
         * Dequeue the entry...
         */
        dequeue_general( (irda_queue_t**) &hashbin->hb_queue[ bin ],
-                        (irda_queue_t*) entry );
+                        entry);
        hashbin->hb_size--;
        entry->q_next = NULL;
        entry->q_prev = NULL;
 
  * handler, according to whether the PPPoX socket is a for a regular session
  * or the special tunnel type.
  */
-static int pppol2tp_getsockopt(struct socket *sock, int level,
-                              int optname, char __user *optval, int __user *optlen)
+static int pppol2tp_getsockopt(struct socket *sock, int level, int optname,
+                              char __user *optval, int __user *optlen)
 {
        struct sock *sk = sock->sk;
        struct l2tp_session *session;
        if (level != SOL_PPPOL2TP)
                return udp_prot.getsockopt(sk, level, optname, optval, optlen);
 
-       if (get_user(len, (int __user *) optlen))
+       if (get_user(len, optlen))
                return -EFAULT;
 
        len = min_t(unsigned int, len, sizeof(int));
                err = pppol2tp_session_getsockopt(sk, session, optname, &val);
 
        err = -EFAULT;
-       if (put_user(len, (int __user *) optlen))
+       if (put_user(len, optlen))
                goto end_put_sess;
 
        if (copy_to_user((void __user *) optval, &val, len))
 
 
        if (elems->tim && (!elems->parse_error ||
                           !(bss->valid_data & IEEE80211_BSS_VALID_DTIM))) {
-               struct ieee80211_tim_ie *tim_ie =
-                       (struct ieee80211_tim_ie *)elems->tim;
+               struct ieee80211_tim_ie *tim_ie = elems->tim;
                bss->dtim_period = tim_ie->dtim_period;
                if (!elems->parse_error)
                                bss->valid_data |= IEEE80211_BSS_VALID_DTIM;
 
        tstamp = nf_conn_tstamp_find(ct);
        if (tstamp) {
                if (skb->tstamp.tv64 == 0)
-                       __net_timestamp((struct sk_buff *)skb);
+                       __net_timestamp(skb);
 
                tstamp->start = ktime_to_ns(skb->tstamp);
        }
 
        p1->knxt_seq_num = 1;
        p1->pkbdq = pg_vec;
        pbd = (struct tpacket_block_desc *)pg_vec[0].buffer;
-       p1->pkblk_start = (char *)pg_vec[0].buffer;
+       p1->pkblk_start = pg_vec[0].buffer;
        p1->kblk_size = req_u->req3.tp_block_size;
        p1->knum_blocks = req_u->req3.tp_block_nr;
        p1->hdrlen = po->tp_hdrlen;
                h1->ts_first_pkt.ts_sec = ts.tv_sec;
                h1->ts_first_pkt.ts_nsec = ts.tv_nsec;
                pkc1->pkblk_start = (char *)pbd1;
-               pkc1->nxt_offset = (char *)(pkc1->pkblk_start +
-               BLK_PLUS_PRIV(pkc1->blk_sizeof_priv));
+               pkc1->nxt_offset = pkc1->pkblk_start + BLK_PLUS_PRIV(pkc1->blk_sizeof_priv);
                BLOCK_O2FP(pbd1) = (__u32)BLK_PLUS_PRIV(pkc1->blk_sizeof_priv);
                BLOCK_O2PRIV(pbd1) = BLK_HDR_LEN;
                pbd1->version = pkc1->version;
        struct tpacket_block_desc *pbd;
        char *curr, *end;
 
-       pkc = GET_PBDQC_FROM_RB(((struct packet_ring_buffer *)&po->rx_ring));
+       pkc = GET_PBDQC_FROM_RB(&po->rx_ring);
        pbd = GET_CURR_PBLOCK_DESC_FROM_CORE(pkc);
 
        /* Queue is frozen when user space is lagging behind */
        smp_mb();
        curr = pkc->nxt_offset;
        pkc->skb = skb;
-       end = (char *) ((char *)pbd + pkc->kblk_size);
+       end = (char *)pbd + pkc->kblk_size;
 
        /* first try the current block */
        if (curr+TOTAL_PKT_LEN_INCL_ALIGN(len) < end) {
 
                warn("Port creation failed, no memory\n");
                return -ENOMEM;
        }
-       p_ptr = (struct tipc_port *)tipc_createport_raw(NULL, port_dispatcher,
-                                                  port_wakeup, importance);
+       p_ptr = tipc_createport_raw(NULL, port_dispatcher, port_wakeup,
+                                   importance);
        if (!p_ptr) {
                kfree(up_ptr);
                return -ENOMEM;
        if (tp_ptr->connected) {
                tp_ptr->connected = 0;
                /* let timer expire on it's own to avoid deadlock! */
-               tipc_nodesub_unsubscribe(
-                       &((struct tipc_port *)tp_ptr)->subscription);
+               tipc_nodesub_unsubscribe(&tp_ptr->subscription);
                res = 0;
        } else {
                res = -ENOTCONN;
        p_ptr = tipc_port_lock(ref);
        if (!p_ptr)
                return -EINVAL;
-       res = tipc_disconnect_port((struct tipc_port *)p_ptr);
+       res = tipc_disconnect_port(p_ptr);
        tipc_port_unlock(p_ptr);
        return res;
 }
 
 };
 
 #define tipc_sk(sk) ((struct tipc_sock *)(sk))
-#define tipc_sk_port(sk) ((struct tipc_port *)(tipc_sk(sk)->p))
+#define tipc_sk_port(sk) (tipc_sk(sk)->p)
 
 #define tipc_rx_ready(sock) (!skb_queue_empty(&sock->sk->sk_receive_queue) || \
                        (sock->state == SS_DISCONNECTING))