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: 9392391 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.web.codeaurora.org (Postfix) with ESMTP id 35FE960762 for ; Mon, 24 Oct 2016 15:42:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 291B628757 for ; Mon, 24 Oct 2016 15:42:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D8B229046; Mon, 24 Oct 2016 15:42:57 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B28B728757 for ; Mon, 24 Oct 2016 15:42:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965343AbcJXPmh (ORCPT ); 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-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:TfNJBYXPWmRFwD7TD4Vu8UfbxYa9vssAJIY4Jztvz1jCgOsSh7G wprIga5vNwjlWYeYEA750R0Rh1FqLHz+idBlLwqAAj2JUh0FF9ctSm0e3LSokPNSdCla0Um IJ/MeWYWxlPJG0CtFPZyrvyaH03ipB2RZKKnKh7fSdYSxOc79HAS8N2PXB4ir5l5z5FOtEw FLxYXbeFh2Z98V2lkWQRw== X-UI-Out-Filterresults: notjunk:1; V01:K0:/8lhQBa0ZBg=:ajihF6ccqsj6Ug6USzgCIC 6ZO1PJW5pcqu77mEfOx7ErgZsLfgnVFCLpfUOiB+g7cQJ4b6lKUkPHsGovfxPXOsSLMlyr9ra wxZaYgx1xl+ZmgMtrp5xN8AEvny8N+0vo2PmUPALuMadLDoXupa5FMpfSvcsUSFajyV3FlWEa tHwbobFtj1gOoFy1gzQMdeRanSKkj+4fLvpJwDDWUfnV7XFLhRQUDJlHjAClCeuTjmBdK6d9k bRHr52inoAZKB9OfoDMD+7YWAN+GSSGPBoidx35tlU+iNzej9z9GJsSjHtMpq2pxzKq8S/FTH kusEVXVTkr91gv3jitKrrn+GDkVjq1cWZJyA8PC/VEcjmLwP8wRVOlyX03ZsiRobgM57wLxgZ y/+3GbMomPDepqxxEZOXDHuq5vUmeW/pOcBETWDWUz1kBG7uvJwyaNSFs8rJfNg/t25P3XeZc Q/deXWXj4NnjxI5Jz9Ty5KkJz+eyoFyXc0r/ooxCkJqP5jo0C/PalqtRYqxKnGhcdFa/xsc4u KSglrY3RQ3ClR9aUF1y64d1kwU2X0s9f13rp2zmR4amQj1npMSWMl1bXeUWsc1z0LImUutQyP isqYx2rMCC3Rel7n2enkxtcXSblHsC6vmhaL1t5q3CtQ11sRslLPYo7ir5mmRj1mF8Qnoy+/l rVdBVHw0VOPkdydNXZaSi6Yk+ovRKy/KMj2EOvNmYc5Xxu4MPU/WPPFTfSwJ8idQexOq7bW4S oX48PmHmHbLejSOw Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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) {