Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp365599yba; Fri, 26 Apr 2019 01:10:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqweo15vNuxePDePzP2QwCkbjaTPpL/pGdf/bD7Mj5OCRVh6A2nlBYPy8KVX8P30wAkjGXcG X-Received: by 2002:aa7:8b12:: with SMTP id f18mr46709907pfd.89.1556266238767; Fri, 26 Apr 2019 01:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556266238; cv=none; d=google.com; s=arc-20160816; b=YzvB+/0fTW+3LeoXm8Q1IiVZQu5QhtPJK4RD864SMWBSfT/8ELIYGIX1JNzXdUzJDc VzKNR/nwuQVaVBrK3C/VqE0LplhNxVhjQdCtQ52ZuygFKt2vGB3VuqgA/bw5khDcPX6k hkkRHvJ6AoVQ88lf9punaVSElfowrqLGLnIYkv5ji2NhBDUGozxMXC+WbuOS+0yrsXVJ RMbW+E7knk1gQvbo+34RP3+1givRpTZ5eAfOgt4YEj0LTmes/zQw/3dsZcb2kW5PxEqz LPKzRCIdbZIEjBMPcv5Y8ACvGYiK7UXvpJ5CIvH8l5XPuRct+khx+CDgNtDyWEDP8aux tLSQ== 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=L/OFy5EdlzWbyuASzGYyFNrbYRVs4cBKnKGH5HdCHUM=; b=nI1onJwtBx0DGbKB0z2KTYL/1HGgzEwAjwDznbjntmIPZkYz/AJBCW/qhkplLLEf+Z Z+jNOS7SN10IcGu972Srh0NgvPayx5M07c6VNvJ6V0lYROmKhn8sLLMZniiG1VDLj6oY p6nY4+YiqqJIOiLY9BtnUwYleE4Ue06jkfD0YjDQEB4+xNfiP8qU71ONnHGhbv/0RSMB 6V3VeaY4UmxzCU1uqi82FaCiW6ZHLMipFbHas4S6qv36d6DWIUSZ6TY0QNTNaghWEkfw Sy/I5FblpmdgKmYJ1SJyr4KlQbIFvE1/YM2wB4KkdawhPBVnCPHJDiS9p8bOylJNu14K Psew== 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 68si9879318pla.86.2019.04.26.01.10.23; Fri, 26 Apr 2019 01:10:38 -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 S1725971AbfDZIJf (ORCPT + 99 others); Fri, 26 Apr 2019 04:09:35 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:11469 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725854AbfDZIJe (ORCPT ); Fri, 26 Apr 2019 04:09:34 -0400 X-UUID: cd9fc6e4eee9439f88dd73de72256b5f-20190426 X-UUID: cd9fc6e4eee9439f88dd73de72256b5f-20190426 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 342274836; Fri, 26 Apr 2019 16:09:30 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 26 Apr 2019 16:09:29 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 26 Apr 2019 16:09:29 +0800 From: Ryder Lee To: Lorenzo Bianconi , Felix Fietkau , Stanislaw Gruszka CC: Roy Luo , YF Luo , Yiwei Chung , Sean Wang , , , , Ryder Lee Subject: [PATCH v2] mt76: fix endianness sparse warnings Date: Fri, 26 Apr 2019 16:09:22 +0800 Message-ID: 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 --- Change since v2: use standard le16_to_cpu() instead of underscored version --- 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..b1d96a46a41c 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..b8f48d10f27a 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