Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1913649yba; Thu, 25 Apr 2019 07:43:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzehvXyP57d7SbsGtNs1xbkYKaFDhw/zSCeLW6mhbCVBOlyvm1vO7PzL/PxYu+hmPHBcJWx X-Received: by 2002:a62:51c5:: with SMTP id f188mr2153872pfb.239.1556203403115; Thu, 25 Apr 2019 07:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556203403; cv=none; d=google.com; s=arc-20160816; b=D8Q5J0rbGM+hd2LJUgpLSWoIt83BZiMTBsQlh6vaF9Re+fcVbeDAU8RagFf9nh6xJe XaxMBjg9G51/UBxePHwB0U0299fG7Jz2tbmYRpY/ziyaw6JckfFp+SIypUmdW3OMZmwp L0d84xKsRv9dWAf/+E3KH3iitLaA+PF49NHvOhDHO979hWvOYloTrYlf+mOGiXDW8c+r uJeglbswVs62PpS+Ir1FGzweR0B5OGeIxBIvGC5qsiRXT1bFlOu/qIkk8wajMahmZXaI LmJ+zPPi1mMxO7Jk00skqsyaxlDsoA0gv/RfKjHEe+huYjml/5XdU9rNPpvPppZgZc8p RDEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=zxAxTt0cF+oelvk9IcKS0BSrk2J99S3AS8N5l+tkvT8=; b=czkoFeiA6XCtedRSSwST1aOFgseYMzxrtGGTTsHBIVYwZtDcRS3xY3y3AitauQNg0b j5vHoM6WCMrFnp4uWnLu70FPaUq9/6wxZ7OcChS59zxftxl72auhRWzhSMzFS0hTINaS f7QRNYE8DTaeXGZThoblU+nSAg1j3AkApD6YkQoXbfX1g0TframbYZ2rxdTzx0X+v11B Qq9xnYbzgfTZcNCeiNB9YXMYnQBLjHnswe+nDjJOdjs5A8nSNiJJ23JQxy1s7rJBcGFV fQbQqwtoG8uwwk1JJCMI/KUMvoeCdoV2cu7+Nk9ty5CCXy4J8wb5KqIdsK/oh1Uvuc3l f+Ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si4324486pgg.83.2019.04.25.07.43.07; Thu, 25 Apr 2019 07:43:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbfDYOmM (ORCPT + 99 others); Thu, 25 Apr 2019 10:42:12 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:61175 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725900AbfDYOmM (ORCPT ); Thu, 25 Apr 2019 10:42:12 -0400 X-UUID: 1237c519beb144d0bed54fd807e93833-20190425 X-UUID: 1237c519beb144d0bed54fd807e93833-20190425 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 809769604; Thu, 25 Apr 2019 22:42:04 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 25 Apr 2019 22:42:03 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 25 Apr 2019 22:42:03 +0800 From: Ryder Lee To: Lorenzo Bianconi , Felix Fietkau CC: Roy Luo , Sean Wang , , , , Ryder Lee Subject: [PATCH] mt76: fix endianness sparse warnings Date: Thu, 25 Apr 2019 22:42:01 +0800 Message-ID: <865a5eb36f295fc81e3dcbe95929dcfce4956897.1556203212.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix many warnings with incorrect endian assumptions. Reported-by: kbuild test robot Signed-off-by: Ryder Lee --- drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index 2f2961ee0a92..af5769d05e6f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -627,7 +627,7 @@ mt7603_mac_fill_rx(struct mt7603_dev *dev, struct sk_buff *skb) status->aggr = unicast && !ieee80211_is_qos_nullfunc(hdr->frame_control); status->tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; - status->seqno = IEEE80211_SEQ_TO_SN(hdr->seq_ctrl); + status->seqno = IEEE80211_SEQ_TO_SN(__le16_to_cpu(hdr->seq_ctrl)); return 0; } diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 1bf3e7b5f6a7..4b934b0f5a39 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -235,7 +235,7 @@ int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb) status->aggr = unicast && !ieee80211_is_qos_nullfunc(hdr->frame_control); status->tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; - status->seqno = IEEE80211_SEQ_TO_SN(hdr->seq_ctrl); + status->seqno = IEEE80211_SEQ_TO_SN(__le16_to_cpu(hdr->seq_ctrl)); return 0; } @@ -337,7 +337,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, struct ieee80211_vif *vif = info->control.vif; int tx_count = 8; u8 fc_type, fc_stype, p_fmt, q_idx, omac_idx = 0; - u16 fc = le16_to_cpu(hdr->frame_control); + __le16 fc = hdr->frame_control; u16 seqno = 0; u32 val; @@ -353,8 +353,8 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, tx_count = msta->rate_count; } - fc_type = (fc & IEEE80211_FCTL_FTYPE) >> 2; - fc_stype = (fc & IEEE80211_FCTL_STYPE) >> 4; + fc_type = (le16_to_cpu(fc) & IEEE80211_FCTL_FTYPE) >> 2; + fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4; if (ieee80211_is_data(fc)) { q_idx = skb_get_queue_mapping(skb); @@ -468,7 +468,7 @@ void mt7615_txp_skb_unmap(struct mt76_dev *dev, txp = (struct mt7615_txp *)(txwi + MT_TXD_SIZE); for (i = 1; i < txp->nbuf; i++) dma_unmap_single(dev->dev, le32_to_cpu(txp->buf[i]), - le32_to_cpu(txp->len[i]), DMA_TO_DEVICE); + le16_to_cpu(txp->len[i]), DMA_TO_DEVICE); } int mt7615_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, @@ -506,7 +506,7 @@ int mt7615_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, txp = (struct mt7615_txp *)(txwi + MT_TXD_SIZE); for (i = 0; i < nbuf; i++) { txp->buf[i] = cpu_to_le32(tx_info->buf[i + 1].addr); - txp->len[i] = cpu_to_le32(tx_info->buf[i + 1].len); + txp->len[i] = cpu_to_le16(tx_info->buf[i + 1].len); } txp->nbuf = nbuf; -- 2.18.0