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: 150065 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2269357ljp; Fri, 2 Nov 2018 09:19:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5cOiNMYvPoogQumfrAM7iN1+qXykJJr5xYenY5tYl2qAIYY6i8kI9yD99xG3HCQUODf7yWw X-Received: by 2002:a63:480d:: with SMTP id v13-v6mr11471258pga.308.1541175543719; Fri, 02 Nov 2018 09:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541175543; cv=none; d=google.com; s=arc-20160816; b=sh7D7mYG+msQ+/9n4Wm6u7Au23N72NmTcVapJD5O2m0+va9SGEEHTo7lhSYKRGnlnw NAhabhPf/qhneX4JojDz6wAUblxfqFuf/dKldRs2GZjKLiq/nmzav3d9KtmZD96P9s+i tV0+/+Ih8nKFxoSpRBY6f4UsxoOaRf6kKjNxfQDvxKoBBjYoXAdYHA1dLIw9RXNonnVq tpWn+CEgBCiDkJjnPQRN9OR/cIDq0Y39Ggx+AcUhVkhF00E/dE+3PCDIw+h1MXOesJ0F R/i0kWIbZn2V0japYKp2Ly7Ix7BljRgbzmkdO1wDTyDphG3VJA+5YsCI02YymBsslosS hvWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=mDxEdIcLFTLr+Gx6mXP3URY9g5y0WhsyKJ5PtxAD9d4=; b=R5tre3GPX0YrVv82Xsvc3ZAF5Z4nNTPkOupj7SU4ziLZvG9RShSzRuNIdM9WiyEK6C PDhUKHA09gqm3nqN6z1y38lHiSs3ynSau+UOo3MgUkdpHSPoCtM6gwhijpE4O4gHHQbK a/AoOQuOhteo5HoOq9Ir+0xgX80tsHDyPIGXkBPj9cjBbWtnvpJI+BOGmXhLcQTIEUFd SHYfv3pdl3eaLR5VVEZ/0tpx24pSP0nkHk6k4r3teBWmSauRzfUouWYft/0L8oR2QTGY tsgO7JbyMqYSILdd7eQYAIGLKQQLt+Nz4UbA8KZYIvQ80qeLcEaIGfHdCOQkXi71Q/G9 2+Dw== 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 y11-v6si3310590plg.65.2018.11.02.09.19.03; Fri, 02 Nov 2018 09:19:03 -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 S1728002AbeKCB0j (ORCPT + 32 others); Fri, 2 Nov 2018 21:26:39 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:34937 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbeKCB0j (ORCPT ); Fri, 2 Nov 2018 21:26:39 -0400 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" Cc: Arnd Bergmann , Rakesh Pillai , Anilkumar Kolli , Balaji Pothunoori , Yingying Tang , Sriram R , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org 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-Spam-Flag: NO 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= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.18.0 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;