From patchwork Mon Oct 24 15:41:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101619 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2646286qge; Mon, 24 Oct 2016 08:42:46 -0700 (PDT) X-Received: by 10.99.1.23 with SMTP id 23mr24884833pgb.37.1477323765334; Mon, 24 Oct 2016 08:42:45 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h29si15983504pfd.139.2016.10.24.08.42.40; Mon, 24 Oct 2016 08:42:45 -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 S965360AbcJXPmh (ORCPT + 27 others); Mon, 24 Oct 2016 11:42:37 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:51927 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965191AbcJXPmf (ORCPT ); Mon, 24 Oct 2016 11:42:35 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0Lx7w9-1d0wrP2egz-016eyL; Mon, 24 Oct 2016 17:42:22 +0200 From: Arnd Bergmann To: Solomon Peachy , Kalle Valo Cc: Arnd Bergmann , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cw1200: fix bogus maybe-uninitialized warning Date: Mon, 24 Oct 2016 17:41:49 +0200 Message-Id: <20161024154215.2863586-1-arnd@arndb.de> X-Mailer: git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w Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On x86, the cw1200 driver produces a rather silly warning about the possible use of the 'ret' variable without an initialization presumably after being confused by the architecture specific definition of WARN_ON: drivers/net/wireless/st/cw1200/wsm.c: In function ‘wsm_handle_rx’: drivers/net/wireless/st/cw1200/wsm.c:1457:9: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized] As the driver just checks the same variable twice here, we can simplify it by removing the second condition, which makes it more readable and avoids the warning. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/st/cw1200/wsm.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.9.0 diff --git a/drivers/net/wireless/st/cw1200/wsm.c b/drivers/net/wireless/st/cw1200/wsm.c index 680d60eabc75..094e6637ade2 100644 --- a/drivers/net/wireless/st/cw1200/wsm.c +++ b/drivers/net/wireless/st/cw1200/wsm.c @@ -385,14 +385,13 @@ static int wsm_multi_tx_confirm(struct cw1200_common *priv, if (WARN_ON(count <= 0)) return -EINVAL; - if (count > 1) { - /* We already released one buffer, now for the rest */ - ret = wsm_release_tx_buffer(priv, count - 1); - if (ret < 0) - return ret; - else if (ret > 0) - cw1200_bh_wakeup(priv); - } + /* We already released one buffer, now for the rest */ + ret = wsm_release_tx_buffer(priv, count - 1); + if (ret < 0) + return ret; + + if (ret > 0) + cw1200_bh_wakeup(priv); cw1200_debug_txed_multi(priv, count); for (i = 0; i < count; ++i) {