[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181006011843.GC32455@lunn.ch>
Date: Sat, 6 Oct 2018 03:18:43 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Igor Russkikh <Igor.Russkikh@...antia.com>
Cc: "David S . Miller" <davem@...emloft.net>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
Subject: Re: [PATCH net-next 09/19] net: usb: aqc111: Implement RX data path
> +static int aqc111_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
> +{
> + struct sk_buff *new_skb = NULL;
> + u32 skb_len = 0;
> + u32 desc_offset = 0; /*RX Header Offset*/
> + u32 start_of_descs = 0;
> + u16 pkt_count = 0;
> + u32 pkt_total_offset = 0;
> + struct aq_rx_packet_desc *pkt_desc = NULL;
> + struct aq_rx_desc_header desc_hdr;
> +
> + if (!skb)
> + goto err;
> +
> + if (skb->len == 0)
> + goto err;
> +
> + skb_len = skb->len;
> + /* RX Offset Header */
> + skb_trim(skb, skb->len - sizeof(struct aq_rx_desc_header));
> + memcpy(&desc_hdr, skb_tail_pointer(skb),
> + sizeof(struct aq_rx_desc_header));
> + le64_to_cpus(&desc_hdr);
Same question as for TX.
> +
> + /* Check these packets */
> + desc_offset = (u32)desc_hdr.desc_offset;
I don't think you need the cast here.
Please review all your casts and remove any that are not needed.
Andrew
Powered by blists - more mailing lists