Re: [PATCH net-next 09/19] net: usb: aqc111: Implement RX data path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux