From patchwork Tue May 28 05:48:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 10963713 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A979E15E6 for ; Tue, 28 May 2019 05:48:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 989F0286BC for ; Tue, 28 May 2019 05:48:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CB50286BF; Tue, 28 May 2019 05:48:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 262FC286BD for ; Tue, 28 May 2019 05:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=yg167FAlvk9bD+xugZO+Pr9T00XFZe1LKeeBEZ6kUG0=; b=kwa7Ei+P5wQv5g +mcgDqCtNyogvLFQAfTl6c8/w9e5liqHHFlGSeuoF8ICjgeSTEOlncx1PABwphSqJU3E5Cw9AGDoj UKJwVYqL/UQg9e+p4vzunlCKrSkiChdWvWjfa5Qs63eu96d54QC/qGgH6b9BdI9+TqWCapC+9nhWq /M3OyTBDtYGCP5On6C/cKZosa6LDlqU22M0xnH9x3UBj0oOmW7+lc5msR+Bwx6RlBJEU3Au6Wf7UQ VcfD50Byt34/uyqZiHHoG68uaJGN9zuSFGqSqVrEuJuxeXKqgGokNlGZWd73f6BTJR/jYEPzzIT3L 1p3IlA5NBYvQEvHFigkg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVUyL-0007Bt-R1; Tue, 28 May 2019 05:48:29 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVUyJ-0007AX-2d for ath11k@lists.infradead.org; Tue, 28 May 2019 05:48:28 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6A5EE607C3; Tue, 28 May 2019 05:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559022505; bh=MceRDbahM1MBZZnmB6sxD+GmTbpmCt9R8inXYch8PMc=; h=From:To:Subject:Date:From; b=hfLgQdI6f9JPwrD0j1tei7CnErZp8DTk6p9cik8ifXAdxPhomUEOZH1mtAlxO18Vq iMnP79d/uvzniWosOFkv7OIk2QZaVo2yruc86Ou9ZRRruaD8vSW/LkCcNdWwNP+8cF RJ7ytm4FrIqe8XEz9uzY5GiqSVH2JbFysk8SDOAc= Received: from vasanth-lnx.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vthiagar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7CF1260795 for ; Tue, 28 May 2019 05:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559022505; bh=MceRDbahM1MBZZnmB6sxD+GmTbpmCt9R8inXYch8PMc=; h=From:To:Subject:Date:From; b=hfLgQdI6f9JPwrD0j1tei7CnErZp8DTk6p9cik8ifXAdxPhomUEOZH1mtAlxO18Vq iMnP79d/uvzniWosOFkv7OIk2QZaVo2yruc86Ou9ZRRruaD8vSW/LkCcNdWwNP+8cF RJ7ytm4FrIqe8XEz9uzY5GiqSVH2JbFysk8SDOAc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7CF1260795 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vthiagar@codeaurora.org From: Vasanthakumar Thiagarajan To: ath11k@lists.infradead.org Subject: [PATCH 1/4] ath11k: Fix endianness related sparse warnings Date: Tue, 28 May 2019 11:18:03 +0530 Message-Id: <1559022486-7073-1-git-send-email-vthiagar@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190527_224827_152737_1407D1C2 X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/net/wireless/ath/ath11k/hal_rx.c:1142:27: warning: cast to restricted __le32 drivers/net/wireless/ath/ath11k/hal_rx.c:1142:27: warning: cast to restricted __le32 drivers/net/wireless/ath/ath11k/dp_rx.c:3433:16: warning: Using plain integer as NULL pointer drivers/net/wireless/ath/ath11k/dp_rx.h:335:19: warning: cast to restricted __le32 drivers/net/wireless/ath/ath11k/dp_rx.h:335:19: warning: restricted __le32 degrades to integer drivers/net/wireless/ath/ath11k/dp_rx.h:335:19: warning: restricted __le32 degrades to integer drivers/net/wireless/ath/ath11k/dp_rx.h:344:35: warning: incorrect type in return expression (different base types) drivers/net/wireless/ath/ath11k/dp_rx.h:344:35: expected unsigned int drivers/net/wireless/ath/ath11k/dp_rx.h:344:35: got restricted __le16 [usertype] phy_ppdu_id drivers/net/wireless/ath/ath11k/dp_rx.h:306:16: warning: cast to restricted __le32 drivers/net/wireless/ath/ath11k/dp_rx.h:306:16: warning: restricted __le32 degrades to integer drivers/net/wireless/ath/ath11k/dp_rx.h:306:16: warning: restricted __le32 degrades to integer drivers/net/wireless/ath/ath11k/dp_rx.h:316:16: warning: cast to restricted __le32 drivers/net/wireless/ath/ath11k/dp_rx.h:316:16: warning: restricted __le32 degrades to integer drivers/net/wireless/ath/ath11k/dp_rx.h:316:16: warning: restricted __le32 degrades to integer Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath11k/dp_rx.h | 10 ++++++---- drivers/net/wireless/ath/ath11k/hal_rx.h | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.h b/drivers/net/wireless/ath/ath11k/dp_rx.h index 5fe6e6d..75d9150 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.h +++ b/drivers/net/wireless/ath/ath11k/dp_rx.h @@ -303,7 +303,8 @@ static inline u32 ath11k_dp_rxdesc_get_mpdulen_err(void *hw_desc_addr) rx_attn = &rx_desc->attention; - return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, rx_attn->info1); + return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, + __le32_to_cpu(rx_attn->info1)); } static inline u32 ath11k_dp_rxdesc_get_decap_format(void *hw_desc_addr) @@ -314,7 +315,7 @@ static inline u32 ath11k_dp_rxdesc_get_decap_format(void *hw_desc_addr) rx_msdu_start = &rx_desc->msdu_start; return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, - rx_msdu_start->info2); + __le32_to_cpu(rx_msdu_start->info2)); } static inline u8 *ath11k_dp_rxdesc_get_80211hdr(void *hw_desc_addr) @@ -332,7 +333,8 @@ static inline bool ath11k_dp_rxdesc_mpdu_valid(void *hw_desc_addr) struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; u32 tlv_tag; - tlv_tag = FIELD_GET(HAL_TLV_HDR_TAG, rx_desc->mpdu_start_tag); + tlv_tag = FIELD_GET(HAL_TLV_HDR_TAG, + __le32_to_cpu(rx_desc->mpdu_start_tag)); return tlv_tag == HAL_RX_MPDU_START ? true : false; } @@ -341,7 +343,7 @@ static inline u32 ath11k_dp_rxdesc_get_ppduid(void *hw_desc_addr) { struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; - return rx_desc->mpdu_start.phy_ppdu_id; + return __le16_to_cpu(rx_desc->mpdu_start.phy_ppdu_id); } int ath11k_dp_rx_ampdu_start(struct ath11k *ar, diff --git a/drivers/net/wireless/ath/ath11k/hal_rx.h b/drivers/net/wireless/ath/ath11k/hal_rx.h index 439a36f..650ebe5 100644 --- a/drivers/net/wireless/ath/ath11k/hal_rx.h +++ b/drivers/net/wireless/ath/ath11k/hal_rx.h @@ -270,9 +270,9 @@ struct hal_rx_phyrx_rssi_legacy_info { #define HAL_RX_MPDU_INFO_INFO0_PEERID GENMASK(31, 16) struct hal_rx_mpdu_info { - u32 rsvd0; - u32 info0; - u32 rsvd1[21]; + __le32 rsvd0; + __le32 info0; + __le32 rsvd1[21]; } __packed; struct hal_rx_rxpcu_classification_overview {