Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2594ca30 authored by Shraddha Barke's avatar Shraddha Barke Committed by Greg Kroah-Hartman
Browse files

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: default avatarShraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7f44582e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ static int init_usb(struct lte_udev *udev)

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);