From: Andrew Lunn <andrew@lunn.ch>
To: Igor Russkikh <Igor.Russkikh@aquantia.com>
Cc: "David S . Miller" <davem@davemloft.net>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com>
Subject: [net-next,09/19] net: usb: aqc111: Implement RX data path
Date: Sat, 6 Oct 2018 03:18:43 +0200 [thread overview]
Message-ID: <20181006011843.GC32455@lunn.ch> (raw)
> +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
next reply other threads:[~2018-10-06 1:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-06 1:18 Andrew Lunn [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-10-09 13:39 [net-next,09/19] net: usb: aqc111: Implement RX data path Bjørn Mork
2018-10-05 10:25 Igor Russkikh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181006011843.GC32455@lunn.ch \
--to=andrew@lunn.ch \
--cc=Dmitry.Bezrukov@aquantia.com \
--cc=Igor.Russkikh@aquantia.com \
--cc=davem@davemloft.net \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).