Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1050131yba; Thu, 4 Apr 2019 03:15:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyT6vhjPrlBAss3DQNN/N9pUZzDxW7Q4GXNjmLqiVrOD/zd7bCWsUz12XsZxNWaEDvkEhWq X-Received: by 2002:aa7:8190:: with SMTP id g16mr5051849pfi.92.1554372923354; Thu, 04 Apr 2019 03:15:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554372923; cv=none; d=google.com; s=arc-20160816; b=jvLCApUmepnWL+oEWpUCi5hnLyDyhrzcbN/NUt9axRsoy4sd3iiAOv+FIX7Oq1Oghw k/bQJZ6+e1ehzprfCBteAJN6Om0hczZbiTmXwN0tmIBVg+Esc5qiWI1+f1O0lTD6W8jA OGR8Pw/2mEaGJdH4Ya4kNBiIhdSwYtswgYPEIlrbTEBYBUNmig9aoXGrnXgeBY75O7QW e6Q95w7lGwRwARV9hBO7q26ydWRMB4ouRNWIPWKBtqVlBGvloje3BAVtQNO6IqsBSn+L I1sPuRnaZ0yA4cTD6zLV7aTNAECI5eQNNkpO0XxVohePLUOheT1PP9OIQPDNLYrqSRs1 vHwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:user-agent:cc:to :references:in-reply-to:from:subject:content-transfer-encoding :mime-version:dmarc-filter:dkim-signature:dkim-signature; bh=/cEOG38KtsEiMnP6rPvXBpTAgsR/ZfYXMrJ3SX6otL0=; b=ENfd696AtK1xTjvFqMqrwcdMhK3NBJnilC0qX0v8Eo59xB4LJ44VxavEv7S4X+aKSb U+BzEtvBzHx92x/wBWJvyo5xz5uT6MAv2+Wa55+ykPNsgZy+X1/DsTeBD+7VcNNmA45y Ir9gcQUfOoROoh4pNLR6ORu8TKAfHuC4qTMxVz8gahV5Si1VOQNJ9gj1FLQpzeIXpwWT z2xCL1qQrncezxeRSkWGKw4a6JeWppkmsZuFZxcXXfhENk12eekdocxXi68yoFhDHRwO R4e7Mj9873l7Qr6/LFmz8w8TefcUNVzNc1uUGAWmxY8+YetsABdt7mBHvLLSZZCE0uXY zX+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=YzFXdKbe; dkim=pass header.i=@codeaurora.org header.s=default header.b="bSH/uYWt"; 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 a22si15852040plm.263.2019.04.04.03.15.08; Thu, 04 Apr 2019 03:15:23 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=YzFXdKbe; dkim=pass header.i=@codeaurora.org header.s=default header.b="bSH/uYWt"; 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 S1729161AbfDDKO0 (ORCPT + 99 others); Thu, 4 Apr 2019 06:14:26 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:38396 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfDDKOZ (ORCPT ); Thu, 4 Apr 2019 06:14:25 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7C6CF61C62; Thu, 4 Apr 2019 10:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554372863; bh=QDEe9C84mKzr/8f+eseZNo6aGm6/nWFvW/JpXMBHZaY=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=YzFXdKbe9TnTD3PYbdKL/xIEVmIcr54Os6xt2lPbSrZ/XwNrfVpiwL5qZnSMAsPMX S/Bc5ixutpOwEp/hEu1KKtRbubbt+O4IIfHyvmhqwZrAStQC3bYEUJ1lzk9e8hQVMy gSbBuYmA9GjqlEoGN1R4jdyK9YAx0hJ1UVHdKpK8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MISSING_DATE,MISSING_MID autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E308761701; Thu, 4 Apr 2019 10:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554372860; bh=QDEe9C84mKzr/8f+eseZNo6aGm6/nWFvW/JpXMBHZaY=; h=Subject:From:In-Reply-To:References:To:Cc:From; b=bSH/uYWtJ1hexBizuorT5QJXCE7nctHSbKA+7QIF5LBgatWTWlg6ZnejNmntpdgjF bcY1xoFFnoFBMi0OYHardCvkXMv7krn84wgCeVYJdfYMChBFysSexAaq24P0GBPl3n fPjKR42RcxkX0CqTZxsRQPoHtrNN/nEuocU8pp1U= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E308761701 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 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] b43: shut up clang -Wuninitialized variable warning From: Kalle Valo In-Reply-To: <20190322143725.1332353-1-arnd@arndb.de> References: <20190322143725.1332353-1-arnd@arndb.de> To: Arnd Bergmann Cc: "David S. Miller" , Larry Finger , Arnd Bergmann , Priit Laes , clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor , linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-Id: <20190404101423.7C6CF61C62@smtp.codeaurora.org> Date: Thu, 4 Apr 2019 10:14:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann wrote: > Clang warns about what is clearly a case of passing an uninitalized > variable into a static function: > > drivers/net/wireless/broadcom/b43/phy_lp.c:1852:23: error: variable 'gains' is uninitialized when used here > [-Werror,-Wuninitialized] > lpphy_papd_cal(dev, gains, 0, 1, 30); > ^~~~~ > drivers/net/wireless/broadcom/b43/phy_lp.c:1838:2: note: variable 'gains' is declared here > struct lpphy_tx_gains gains, oldgains; > ^ > 1 error generated. > > However, this function is empty, and its arguments are never evaluated, > so gcc in contrast does not warn here. Both compilers behave in a > reasonable way as far as I can tell, so we should change the code > to avoid the warning everywhere. > > We could just eliminate the lpphy_papd_cal() function entirely, > given that it has had the TODO comment in it for 10 years now > and is rather unlikely to ever get done. I'm doing a simpler > change here, and just pass the 'oldgains' variable in that has > been initialized, based on the guess that this is what was > originally meant. > > Fixes: 2c0d6100da3e ("b43: LP-PHY: Begin implementing calibration & software RFKILL support") > Signed-off-by: Arnd Bergmann > Acked-by: Larry Finger > Reviewed-by: Nathan Chancellor Patch applied to wireless-drivers-next.git, thanks. d825db346270 b43: shut up clang -Wuninitialized variable warning -- https://patchwork.kernel.org/patch/10865933/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches