From patchwork Fri Nov 2 16:17:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10665871 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 F217F109C for ; Fri, 2 Nov 2018 16:19:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDF832C0D9 for ; Fri, 2 Nov 2018 16:19:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D22182C3CD; Fri, 2 Nov 2018 16:19:05 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 2C5612C3DA for ; Fri, 2 Nov 2018 16:19:03 +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:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=eWh2L814kp/UKfF6rSXK6hdf6AaFYA1EtB5JQevZdw4=; b=HxI fSTmowtrDSZXNJBPYc7mokLwub3P88CnpfBM2tjoTKB/250EUBsOKn2vQQzhhY3mjZP+vaoohqGtk rsgcsOuz8LkvCVsXtolOk99LqSuXQT3zwNQ0cfAPhnEjWaZ7ztEVzO5KEhvoebFy8XKJgceYR1OXT Otnuwymficn7xdexkfoyPoa8cfFRij0RHR0/buzw4IcgMI4ajkw4FjFKSrPwJdI1wyMKACGPbJztl J/rus4BX8QLVMvn/ZnQQKe6kz+1hMoj7B31H/c9SUdBYCFBlJCoidGJwI8+80RjWaMds/aAovOS3h yWksswlprJs09GLxcg6PIZoa/p758Kw==; 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 1gIcA0-0006NQ-OM; Fri, 02 Nov 2018 16:19:00 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIc9x-0006Lw-1A for ath10k@lists.infradead.org; Fri, 02 Nov 2018 16:18:59 +0000 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mt6wz-1fPxAL0Dlp-00tVHY; Fri, 02 Nov 2018 17:18:36 +0100 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mt6wz-1fPxAL0Dlp-00tVHY; Fri, 02 Nov 2018 17:18:36 +0100 From: Arnd Bergmann To: Kalle Valo , "David S. Miller" Subject: [PATCH] ath10k: avoid -Wmaybe-uninitialized warning Date: Fri, 2 Nov 2018 17:17:19 +0100 Message-Id: <20181102161833.2956376-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:Q9JgcmppWO9yqO7kbS8UMQNFWZHdXHVgc53eT2yOWLmMEalFhd1 +ckutaHxDinzSaPgjzF5OdRyOxxHzv61eflsGfMsTGLNQvwNNNuKi7mIrUcMjBeRXgrrbNV O0pYcFN9ZsgtYGsABV+3MZJceKtPzTFcNXT2dBYiAD5MbEkGnDtPj6W8SEFT/uqCcRAEJp2 IvsVdJcuEjflOiuqVXKrw== X-UI-Out-Filterresults: notjunk:1;V01:K0:rjgWZt7H4m0=:7PUscBi6x4yMQlBzhWV27+ FKg9BrL3fkVweEqhZ1NA+HOTRaEcMWI9xGi1PqcP0LewGfVPtsdzBVa4cVjIhmW7rkq3t/deH 5lspnsQXHLkfo13aSLjMLAdubShFhxFAWPXKHo+pOv9C4TyyAE8mKkhI5CUjKqAyp4wCV5GA+ QY844YC8bIGpmjUrH9ZL0pdNxAmEC/V71icz2Z/rU/fCNCUK4mU1LxZqvDXGlovI8+yWyI4AF 9FiBhVyrcdAJQL/oW/UBAznSistC7xRnj/Zu3WCs5rGXI791pjgYodtU2nE33W+th8L1Hb/z7 QQtPYq+NAkHcSlG0n/Q6jmFLg964+Lhnba63tgdSYk3BOyDQWj4lG98dEfOzPOPg3gEdBOja2 VVNir98BP9gAvI67xEpp/nmEyP8z75MThhG/0dXWSqd9bhiTD2pvBpEtV5ElKwVvh1OGukcZB CwygaP0IaygQn4//cXdAM/15I8Ymcv+K1ser07JnafyBbHem9hZ0PdNZw033yTycJF+9Ew3R1 ZudBuZiSWgHacGqKD71J+V13JQSXqvNOi6eahYFqezhoAwMXpAapxbvRhxfy5bsTbz+Atn8cc 08AgKkdF9/sZDZcnE+vAnXWKhp43HdOXiWwix4DFrr+7Q/zPYBuAicloG58UEIQcxivpoM4Y+ WnvWPO82Y88EhscwfWypcpi7mFpg86GaPFNq+lRDH3b77wrcBVGrKNVyxoeIZoAqcyfc= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_091857_372645_0C3F8216 X-CRM114-Status: GOOD ( 10.83 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sriram R , Arnd Bergmann , Balaji Pothunoori , Anilkumar Kolli , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Yingying Tang , Rakesh Pillai , ath10k@lists.infradead.org, netdev@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In some configurations the inlining in gcc is suboptimal, causing a false-positive warning: drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_mac_init_rd': drivers/net/wireless/ath/ath10k/mac.c:8374:39: error: 'rd' may be used uninitialized in this function [-Werror=maybe-uninitialized] ar->ath_common.regulatory.current_rd = rd; If we initialize the output of ath10k_mac_get_wrdd_regulatory() before returning, this problem goes away. Fixes: 209b2a68de76 ("ath10k: add platform regulatory domain support") Signed-off-by: Arnd Bergmann --- drivers/net/wireless/ath/ath10k/mac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index a1c2801ded10..0d5fde28ee44 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -8321,6 +8321,8 @@ static int ath10k_mac_get_wrdd_regulatory(struct ath10k *ar, u16 *rd) u32 alpha2_code; char alpha2[3]; + *rd = ar->hw_eeprom_rd; + root_handle = ACPI_HANDLE(&pdev->dev); if (!root_handle) return -EOPNOTSUPP; @@ -8365,11 +8367,9 @@ static int ath10k_mac_init_rd(struct ath10k *ar) u16 rd; ret = ath10k_mac_get_wrdd_regulatory(ar, &rd); - if (ret) { + if (ret) ath10k_dbg(ar, ATH10K_DBG_BOOT, "fallback to eeprom programmed regulatory settings\n"); - rd = ar->hw_eeprom_rd; - } ar->ath_common.regulatory.current_rd = rd; return 0;