Commit 986e10d6 authored by Bjørn Mork's avatar Bjørn Mork Committed by David S. Miller

net: cdc_ncm: endian convert constants instead of variables

Converting the constants used in these comparisons at build
time instead of converting the variables for every received
frame at run time.

Cc: Alexey Orishko <alexey.orishko@gmail.com>
Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5448d75f
...@@ -882,7 +882,7 @@ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) ...@@ -882,7 +882,7 @@ int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in)
nth16 = (struct usb_cdc_ncm_nth16 *)skb_in->data; nth16 = (struct usb_cdc_ncm_nth16 *)skb_in->data;
if (le32_to_cpu(nth16->dwSignature) != USB_CDC_NCM_NTH16_SIGN) { if (nth16->dwSignature != cpu_to_le32(USB_CDC_NCM_NTH16_SIGN)) {
netif_dbg(dev, rx_err, dev->net, netif_dbg(dev, rx_err, dev->net,
"invalid NTH16 signature <%#010x>\n", "invalid NTH16 signature <%#010x>\n",
le32_to_cpu(nth16->dwSignature)); le32_to_cpu(nth16->dwSignature));
...@@ -972,7 +972,7 @@ static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in) ...@@ -972,7 +972,7 @@ static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in)
ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb_in->data + ndpoffset); ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb_in->data + ndpoffset);
if (le32_to_cpu(ndp16->dwSignature) != USB_CDC_NCM_NDP16_NOCRC_SIGN) { if (ndp16->dwSignature != cpu_to_le32(USB_CDC_NCM_NDP16_NOCRC_SIGN)) {
netif_dbg(dev, rx_err, dev->net, netif_dbg(dev, rx_err, dev->net,
"invalid DPT16 signature <%#010x>\n", "invalid DPT16 signature <%#010x>\n",
le32_to_cpu(ndp16->dwSignature)); le32_to_cpu(ndp16->dwSignature));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment