From patchwork Wed Jun 12 08:38:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10988969 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 3138B13AF for ; Wed, 12 Jun 2019 08:38:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E25328516 for ; Wed, 12 Jun 2019 08:38:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12394289B9; Wed, 12 Jun 2019 08:38:11 +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 9C642289BF for ; Wed, 12 Jun 2019 08:38:10 +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=XmT5cJkjU9xi1Do4VC6LgnfjrKL2mtuLGnbgbZrDRVc=; b=jDIAH6dF86Y+YA /mSjNAG23yVkBKEu1l3VZvpSZBlrPyax3m852b65EuXDxpHjIwdj/S4AjWCP3gGuRvJAeyyzEAZJ7 P/21HskuQroFP2+NDJ7o0zVJMr1tXD06RSnMRb+1jQfZi5xFuqgGgH8vsxKX/cRmJj8McyWTv2KcF Cn56by2xZE99I3UekLiv1X5ariLNLWCLXlzYt2bNJ4Ao/BH882AUQbsxOW4NhEKV4sk8ZY40PIAUY +XMIiJEaySwFJazIiUuMczQm/GQuQZoMb/F+thXLfR8FuJzCjlxj/BYWTOjGJtWdBHDSfhDlnShIS IlvfemwUZv0o8RYJyS6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hayll-0007cN-SQ; Wed, 12 Jun 2019 08:38:09 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hayli-0007bf-SJ for ath11k@lists.infradead.org; Wed, 12 Jun 2019 08:38:08 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 955A260275; Wed, 12 Jun 2019 08:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560328686; bh=bKiBnNZ3sOOLlsCBYw99ZNZpFyZdAbLEruxJ+8dV5XE=; h=From:To:Subject:Date:From; b=loziCaFmmpfNNh1si4n4eTVC2T58qQlZrPRf6OiUcSHGUxUOOgJ66WPN/o9t1eHdK uM6X63NSev5kAegH2pysb0vV0yg/o/JgaI7i8XVU3MjdH03P5Z8WAhWTG4u9Y4stiu GJ1aPxpAz+PB4bLNkg/q1uGg5POSAZLRFmk2u3QE= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 865CE6038E for ; Wed, 12 Jun 2019 08:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560328686; bh=bKiBnNZ3sOOLlsCBYw99ZNZpFyZdAbLEruxJ+8dV5XE=; h=From:To:Subject:Date:From; b=loziCaFmmpfNNh1si4n4eTVC2T58qQlZrPRf6OiUcSHGUxUOOgJ66WPN/o9t1eHdK uM6X63NSev5kAegH2pysb0vV0yg/o/JgaI7i8XVU3MjdH03P5Z8WAhWTG4u9Y4stiu GJ1aPxpAz+PB4bLNkg/q1uGg5POSAZLRFmk2u3QE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 865CE6038E 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=kvalo@codeaurora.org From: Kalle Valo To: ath11k@lists.infradead.org Subject: [PATCH] ath11k: fix sparse warnings in mac.c Date: Wed, 12 Jun 2019 11:38:02 +0300 Message-Id: <1560328682-23694-1-git-send-email-kvalo@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190612_013806_969264_3FC2C92B X-CRM114-Status: UNSURE ( 8.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 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/mac.c:1306:83: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/ath11k/mac.c:1306:83: expected unsigned int drivers/net/wireless/ath/ath11k/mac.c:1306:83: got restricted __le16 const [usertype] rx_mcs_80p80 drivers/net/wireless/ath/ath11k/mac.c:1308:83: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/ath11k/mac.c:1308:83: expected unsigned int drivers/net/wireless/ath/ath11k/mac.c:1308:83: got restricted __le16 const [usertype] tx_mcs_80p80 drivers/net/wireless/ath/ath11k/mac.c:1312:73: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/ath11k/mac.c:1312:73: expected unsigned int drivers/net/wireless/ath/ath11k/mac.c:1312:73: got restricted __le16 const [usertype] rx_mcs_160 drivers/net/wireless/ath/ath11k/mac.c:1314:73: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/ath11k/mac.c:1314:73: expected unsigned int drivers/net/wireless/ath/ath11k/mac.c:1314:73: got restricted __le16 const [usertype] tx_mcs_160 drivers/net/wireless/ath/ath11k/mac.c:1320:72: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/ath11k/mac.c:1320:72: expected unsigned int drivers/net/wireless/ath/ath11k/mac.c:1320:72: got restricted __le16 const [usertype] rx_mcs_80 drivers/net/wireless/ath/ath11k/mac.c:1322:72: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/ath11k/mac.c:1322:72: expected unsigned int drivers/net/wireless/ath/ath11k/mac.c:1322:72: got restricted __le16 const [usertype] tx_mcs_80 Fixes: 17aca2d9a969 ("ath11k: add HE support") Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath11k/mac.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index ee1f69524c4c..46d63841e1d1 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1255,6 +1255,7 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, struct peer_assoc_params *arg) { const struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; + u16 v; if (!he_cap->has_he) return; @@ -1303,24 +1304,29 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, case IEEE80211_STA_RX_BW_160: if (he_cap->he_cap_elem.phy_cap_info[0] & IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) { - arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = - he_cap->he_mcs_nss_supp.rx_mcs_80p80; - arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = - he_cap->he_mcs_nss_supp.tx_mcs_80p80; + v = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_80p80); + arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = v; + + v = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_80p80); + arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = v; + arg->peer_he_mcs_count++; } - arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = - he_cap->he_mcs_nss_supp.rx_mcs_160; - arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = - he_cap->he_mcs_nss_supp.tx_mcs_160; + + v = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_160); + arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = v; + + v = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_160); + arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = v; + arg->peer_he_mcs_count++; /* drop through */ default: - arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80] = - he_cap->he_mcs_nss_supp.rx_mcs_80; - arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80] = - he_cap->he_mcs_nss_supp.tx_mcs_80; + v = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_80); + arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80] = v; + v = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_80); + arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80] = v; arg->peer_he_mcs_count++; break; }