mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
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 <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7f44582ea7
commit
2594ca30c0
4 changed files with 13 additions and 13 deletions
|
@ -377,11 +377,11 @@ static s32 gdm_lte_tx_nic_type(struct net_device *dev, struct sk_buff *skb)
|
||||||
break;
|
break;
|
||||||
case ETH_P_IP:
|
case ETH_P_IP:
|
||||||
nic_type |= NIC_TYPE_F_IPV4;
|
nic_type |= NIC_TYPE_F_IPV4;
|
||||||
ip = (struct iphdr *)network_data;
|
ip = network_data;
|
||||||
|
|
||||||
/* Check DHCPv4 */
|
/* Check DHCPv4 */
|
||||||
if (ip->protocol == IPPROTO_UDP) {
|
if (ip->protocol == IPPROTO_UDP) {
|
||||||
struct udphdr *udp = (struct udphdr *)
|
struct udphdr *udp =
|
||||||
(network_data + sizeof(struct iphdr));
|
(network_data + sizeof(struct iphdr));
|
||||||
if (ntohs(udp->dest) == 67 || ntohs(udp->dest) == 68)
|
if (ntohs(udp->dest) == 67 || ntohs(udp->dest) == 68)
|
||||||
nic_type |= NIC_TYPE_F_DHCP;
|
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;
|
break;
|
||||||
case ETH_P_IPV6:
|
case ETH_P_IPV6:
|
||||||
nic_type |= NIC_TYPE_F_IPV6;
|
nic_type |= NIC_TYPE_F_IPV6;
|
||||||
ipv6 = (struct ipv6hdr *)network_data;
|
ipv6 = network_data;
|
||||||
|
|
||||||
if (ipv6->nexthdr == IPPROTO_ICMPV6) /* Check NDP request */ {
|
if (ipv6->nexthdr == IPPROTO_ICMPV6) /* Check NDP request */ {
|
||||||
struct icmp6hdr *icmp6 = (struct icmp6hdr *)
|
struct icmp6hdr *icmp6 =
|
||||||
(network_data + sizeof(struct ipv6hdr));
|
(network_data + sizeof(struct ipv6hdr));
|
||||||
if (icmp6->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION)
|
if (icmp6->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION)
|
||||||
nic_type |= NIC_TYPE_ICMPV6;
|
nic_type |= NIC_TYPE_ICMPV6;
|
||||||
} else if (ipv6->nexthdr == IPPROTO_UDP) /* Check DHCPv6 */ {
|
} else if (ipv6->nexthdr == IPPROTO_UDP) /* Check DHCPv6 */ {
|
||||||
struct udphdr *udp = (struct udphdr *)
|
struct udphdr *udp =
|
||||||
(network_data + sizeof(struct ipv6hdr));
|
(network_data + sizeof(struct ipv6hdr));
|
||||||
if (ntohs(udp->dest) == 546 || ntohs(udp->dest) == 547)
|
if (ntohs(udp->dest) == 546 || ntohs(udp->dest) == 547)
|
||||||
nic_type |= NIC_TYPE_F_DHCP;
|
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)
|
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)
|
void start_rx_proc(struct phy_dev *phy_dev)
|
||||||
|
|
|
@ -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)
|
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;
|
struct mux_pkt_header *mux_header;
|
||||||
unsigned int start_flag;
|
unsigned int start_flag;
|
||||||
unsigned int payload_size;
|
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)
|
static void gdm_mux_rcv_complete(struct urb *urb)
|
||||||
{
|
{
|
||||||
struct mux_rx *r = urb->context;
|
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;
|
struct rx_cxt *rx = &mux_dev->rx;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ static int gdm_tty_recv_complete(void *data,
|
||||||
|
|
||||||
static void gdm_tty_send_complete(void *arg)
|
static void gdm_tty_send_complete(void *arg)
|
||||||
{
|
{
|
||||||
struct gdm *gdm = (struct gdm *)arg;
|
struct gdm *gdm = arg;
|
||||||
|
|
||||||
if (!GDM_TTY_READY(gdm))
|
if (!GDM_TTY_READY(gdm))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -367,7 +367,7 @@ static int init_usb(struct lte_udev *udev)
|
||||||
|
|
||||||
static int set_mac_address(u8 *data, void *arg)
|
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 lte_udev *udev = phy_dev->priv_dev;
|
||||||
struct tlv *tlv = (struct tlv *)data;
|
struct tlv *tlv = (struct tlv *)data;
|
||||||
u8 mac_address[ETH_ALEN] = {0, };
|
u8 mac_address[ETH_ALEN] = {0, };
|
||||||
|
@ -410,8 +410,8 @@ static void do_rx(struct work_struct *work)
|
||||||
list_del(&r->to_host_list);
|
list_del(&r->to_host_list);
|
||||||
spin_unlock_irqrestore(&rx->to_host_lock, flags);
|
spin_unlock_irqrestore(&rx->to_host_lock, flags);
|
||||||
|
|
||||||
phy_dev = (struct phy_dev *)r->cb_data;
|
phy_dev = r->cb_data;
|
||||||
udev = (struct lte_udev *)phy_dev->priv_dev;
|
udev = phy_dev->priv_dev;
|
||||||
hci = (struct hci_packet *)r->buf;
|
hci = (struct hci_packet *)r->buf;
|
||||||
cmd_evt = gdm_dev16_to_cpu(&udev->gdm_ed, hci->cmd_evt);
|
cmd_evt = gdm_dev16_to_cpu(&udev->gdm_ed, hci->cmd_evt);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue