From: Shraddha Barke Date: Wed, 14 Oct 2015 19:28:20 +0000 (+0530) Subject: Staging: gdm724x: Remove unnecessary cast on void pointer X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2594ca30c0ae7f126fc84dc3a795f007c2b2787f;p=openwrt%2Fstaging%2Fblogic.git Staging: gdm724x: Remove unnecessary cast on void pointer void pointers do not need to be cast to other pointer types. Semantic patch: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Shraddha Barke Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c index a8d2cffb411c..8a55ec1e5331 100644 --- a/drivers/staging/gdm724x/gdm_lte.c +++ b/drivers/staging/gdm724x/gdm_lte.c @@ -377,11 +377,11 @@ static s32 gdm_lte_tx_nic_type(struct net_device *dev, struct sk_buff *skb) break; case ETH_P_IP: nic_type |= NIC_TYPE_F_IPV4; - ip = (struct iphdr *)network_data; + ip = network_data; /* Check DHCPv4 */ if (ip->protocol == IPPROTO_UDP) { - struct udphdr *udp = (struct udphdr *) + struct udphdr *udp = (network_data + sizeof(struct iphdr)); if (ntohs(udp->dest) == 67 || ntohs(udp->dest) == 68) nic_type |= NIC_TYPE_F_DHCP; @@ -389,15 +389,15 @@ static s32 gdm_lte_tx_nic_type(struct net_device *dev, struct sk_buff *skb) break; case ETH_P_IPV6: nic_type |= NIC_TYPE_F_IPV6; - ipv6 = (struct ipv6hdr *)network_data; + ipv6 = network_data; if (ipv6->nexthdr == IPPROTO_ICMPV6) /* Check NDP request */ { - struct icmp6hdr *icmp6 = (struct icmp6hdr *) + struct icmp6hdr *icmp6 = (network_data + sizeof(struct ipv6hdr)); if (icmp6->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) nic_type |= NIC_TYPE_ICMPV6; } else if (ipv6->nexthdr == IPPROTO_UDP) /* Check DHCPv6 */ { - struct udphdr *udp = (struct udphdr *) + struct udphdr *udp = (network_data + sizeof(struct ipv6hdr)); if (ntohs(udp->dest) == 546 || ntohs(udp->dest) == 547) nic_type |= NIC_TYPE_F_DHCP; @@ -814,9 +814,9 @@ static int gdm_lte_receive_pkt(struct phy_dev *phy_dev, char *buf, int len) static int rx_complete(void *arg, void *data, int len, int context) { - struct phy_dev *phy_dev = (struct phy_dev *)arg; + struct phy_dev *phy_dev = arg; - return gdm_lte_receive_pkt(phy_dev, (char *)data, len); + return gdm_lte_receive_pkt(phy_dev, data, len); } void start_rx_proc(struct phy_dev *phy_dev) diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index 1cf24e4edf25..97b72a0b4ab7 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -153,7 +153,7 @@ static void put_rx_struct(struct rx_cxt *rx, struct mux_rx *r) static int up_to_host(struct mux_rx *r) { - struct mux_dev *mux_dev = (struct mux_dev *)r->mux_dev; + struct mux_dev *mux_dev = r->mux_dev; struct mux_pkt_header *mux_header; unsigned int start_flag; unsigned int payload_size; @@ -262,7 +262,7 @@ static void remove_rx_submit_list(struct mux_rx *r, struct rx_cxt *rx) static void gdm_mux_rcv_complete(struct urb *urb) { struct mux_rx *r = urb->context; - struct mux_dev *mux_dev = (struct mux_dev *)r->mux_dev; + struct mux_dev *mux_dev = r->mux_dev; struct rx_cxt *rx = &mux_dev->rx; unsigned long flags; diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index 001348ccacf9..655f7688d039 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -167,7 +167,7 @@ static int gdm_tty_recv_complete(void *data, static void gdm_tty_send_complete(void *arg) { - struct gdm *gdm = (struct gdm *)arg; + struct gdm *gdm = arg; if (!GDM_TTY_READY(gdm)) return; diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index ed1a12f504e2..9ceba147d390 100644 --- a/drivers/staging/gdm724x/gdm_usb.c +++ b/drivers/staging/gdm724x/gdm_usb.c @@ -367,7 +367,7 @@ fail: static int set_mac_address(u8 *data, void *arg) { - struct phy_dev *phy_dev = (struct phy_dev *)arg; + struct phy_dev *phy_dev = arg; struct lte_udev *udev = phy_dev->priv_dev; struct tlv *tlv = (struct tlv *)data; u8 mac_address[ETH_ALEN] = {0, }; @@ -410,8 +410,8 @@ static void do_rx(struct work_struct *work) list_del(&r->to_host_list); spin_unlock_irqrestore(&rx->to_host_lock, flags); - phy_dev = (struct phy_dev *)r->cb_data; - udev = (struct lte_udev *)phy_dev->priv_dev; + phy_dev = r->cb_data; + udev = phy_dev->priv_dev; hci = (struct hci_packet *)r->buf; cmd_evt = gdm_dev16_to_cpu(&udev->gdm_ed, hci->cmd_evt);