Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934738AbdDZQQE (ORCPT ); Wed, 26 Apr 2017 12:16:04 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34466 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934512AbdDZQPy (ORCPT ); Wed, 26 Apr 2017 12:15:54 -0400 From: Karim Eshapa To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Karim Eshapa Subject: [PATCH] drivers:staging:wlan-ng:hfa384x_usb: Fixing sparse warnings. Date: Wed, 26 Apr 2017 18:15:40 +0200 Message-Id: <1493223340-13794-1-git-send-email-karim.eshapa@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1989 Lines: 48 Fixing sparse warnings incorrect type assignment. Signed-off-by: Karim Eshapa --- drivers/staging/wlan-ng/hfa384x_usb.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 6134eba..cf6bf65 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3511,20 +3511,24 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev, datap = skb_put(skb, sizeof(struct p80211_caphdr)); caphdr = (struct p80211_caphdr *)datap; - caphdr->version = htonl(P80211CAPTURE_VERSION); - caphdr->length = htonl(sizeof(struct p80211_caphdr)); + caphdr->version = __be32_to_cpu(htonl(P80211CAPTURE_VERSION)); + caphdr->length = __be32_to_cpu( htonl(sizeof( + struct p80211_caphdr))); caphdr->mactime = __cpu_to_be64(rxdesc->time) * 1000; caphdr->hosttime = __cpu_to_be64(jiffies); - caphdr->phytype = htonl(4); /* dss_dot11_b */ - caphdr->channel = htonl(hw->sniff_channel); - caphdr->datarate = htonl(rxdesc->rate); - caphdr->antenna = htonl(0); /* unknown */ - caphdr->priority = htonl(0); /* unknown */ - caphdr->ssi_type = htonl(3); /* rssi_raw */ + + /* dss_dot11_b */ + caphdr->phytype = __be32_to_cpu(htonl(4)); + + caphdr->channel = __be32_to_cpu(htonl(hw->sniff_channel)); + caphdr->datarate = __be32_to_cpu(htonl(rxdesc->rate)); + caphdr->antenna = __be32_to_cpu(htonl(0)); /* unknown */ + caphdr->priority = __be32_to_cpu(htonl(0)); /* unknown */ + caphdr->ssi_type = __be32_to_cpu(htonl(3)); /* rssi_raw */ caphdr->ssi_signal = htonl(rxdesc->signal); caphdr->ssi_noise = htonl(rxdesc->silence); - caphdr->preamble = htonl(0); /* unknown */ - caphdr->encoding = htonl(1); /* cck */ + caphdr->preamble = __be32_to_cpu(htonl(0)); /* unknown */ + caphdr->encoding = __be32_to_cpu(htonl(1)); /* cck */ } /* Copy the 802.11 header to the skb -- 2.7.4