From patchwork Thu Mar 1 15:27:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130308 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2953423edc; Thu, 1 Mar 2018 07:39:26 -0800 (PST) X-Google-Smtp-Source: AG47ELs08eOYJDgT9ZEB2WBU+EStmmDWGDjZevxlb0pmRkyQguoaX267A2Nlb7ue9IydSWKSzkqI X-Received: by 10.99.123.74 with SMTP id k10mr1877148pgn.217.1519918765951; Thu, 01 Mar 2018 07:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918765; cv=none; d=google.com; s=arc-20160816; b=xPbgjGamgS806t/LEwVeBYa9+yXW3LFrEUeecpesOa2hqVFOkF/Ih4EAyziIwDb22c 8P3p7ythzzfMiUWoJkyaOz07QNxfmxBN7zKj/qeGIeY41pTw/rz73PCL/1nq3dFcGanD Kj5iDvsYKHZ4q4TdceVvxRDG0h+Xp5f2KeED7FV75pWaUYe/VAM3sMFhdR7F0ycKMFjO qwLJk5+iZOvKO1osZ77BHa48nxmn14fzuKcXRGv61dXKApIYrWM6JGhCkZa2wwirL3Dw 2Vkts/gfweMyvvoi/3wyAH0Ao0N5ExdTW7GOciE+rM3salbMpb6rAY1Rrale7XC02lEt viLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=U+cksNdNt3bq4BQU43lbxJLUKCrUEwjvtXGWO8RCbk8=; b=UiQC+W9l43mK0i2hwDI0Lum6NPYXmdTuSUBi3gEFGvZ2Z5mDUJOesqV+AKHUwhFXv7 zqUNkyvDR8cliPCbQU0jeVltOBD9EZCaXKgnbLTkssYEiMLBxRpRPV1VNjt1wjbMz/Zy 6/3yVXzQM/ZRV3WaN8+L1f1K/XG+jAzhjcoQU3beTZlbYmSzo9d0NtyeeSwqbA0afzdq j4pY734LUS6AxcuQkF3oiCOxZK3ChJZu6aGq3Zq9ATEjAIFKJ0qI279WD7ehd2MD8D2K 6wKpR15IMMe0IzCJuVY6z2dijMbghy7hm6NHqeAF0pIKXV3GgxVbOnEI5kGhal55b55o Os4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=G8xCgYp8; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si2606322pgc.482.2018.03.01.07.39.25; Thu, 01 Mar 2018 07:39:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@microsoft.com header.s=selector1 header.b=G8xCgYp8; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032598AbeCAPjX (ORCPT + 10 others); Thu, 1 Mar 2018 10:39:23 -0500 Received: from mail-bn3nam01on0096.outbound.protection.outlook.com ([104.47.33.96]:49984 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032557AbeCAPjS (ORCPT ); Thu, 1 Mar 2018 10:39:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=U+cksNdNt3bq4BQU43lbxJLUKCrUEwjvtXGWO8RCbk8=; b=G8xCgYp8Og7JM914p9LvOhi5XpZCjhOTcB2STxNXq0nG51smmmRzqUGTVAXG4sf/xHBjevQ+DO1Nu8QhjLOAB0tXTGWsIZhrcEQwo0C5vLJ21EbSl+uLaNiPIFTIcX+AsZ/ONobOTKHIOQiOjk1qWnvbV1jbLsmQ6JHVFCCfwfg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0902.namprd21.prod.outlook.com (52.132.132.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:39:13 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:39:13 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Kalle Valo , Sasha Levin Subject: [added to the 4.1 stable tree] cw1200: fix bogus maybe-uninitialized warning Thread-Topic: [added to the 4.1 stable tree] cw1200: fix bogus maybe-uninitialized warning Thread-Index: AQHTsXHVw5WwtD4180uiHkRGwKqi1A== Date: Thu, 1 Mar 2018 15:27:38 +0000 Message-ID: <20180301152116.1486-483-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0902; 6:72rE3/CBeWqrj/ym1PAsO/ths5VVSaVxtOg86qLvYIlBKqsUZAkZXnbjEglBaoSUQ/kEwQN5QMKXnkuuYV8aFx2gLQXkDf3F+EzZNEe8KnXyONQrTH/3obVfMZm8GnZmbPkdg+m7WIcb/Vi1KQ3SEtI4KJ+IJOYwLkORVgk6YyHoNzfWO+LvMeog29jDszVkW2YvfbF8l+03mPN9f/aYSUjSFZhFW9MageViHkiJOwnROg2miS/+xldoypkqR3RgLrQ7VrHyHwNBwi4C82DR7TMl89E/dj9npnwLO3AMXs66WDTrunFtn+gd83Wn5COExj92L6YV4f4Viayjz61IojEXFFgjRBTtSLxaxtG0ZzIbovzptDXq3zqMFEF8ULQf; 5:DJJ5x5INAXY3r3wihtff6WJl5Wljtpixf/i32dUgeyeG/wYt2J8a1lDtDPnYXPxkomcSTMOtNXiSoYN3uZZQGQC2oDPFnZrq8PVgyyIVLoWmMOLT/tc5Dji4XfbPk4MS7j1u2FcQsw3X14AuPeEX1X8lv8cOYZ0L/ZgnW14hlxs=; 24:YaZUHRrEIBA7rcBmRXmaB2XH+h1NGs2+hjTWdTzroZQvwKKWHiVeeO9MttpKYwPu0vC5x+nnWbamriPLHNmft/MwhbvUiYRVOngQxSuiM6U=; 7:UnttQBEv8rECcpIxZYWF/zVtJFqgbcWHq5N5Sut1krpjqHv3Byi3TeQQZTtVmXMBwjFkmLax2Q0JzTaFA8u5/ohJRrLK+5Qmd8xxz/VEm85lm28w7yCWRfT1cJRziKqw/zum6BLzmeSt7AcO4ZJGjvTSL3sFcus2IDrM+VrfdOzIGCIHAlDlseZrapzA4hhvlaTcTQgdtIB+RJo2jI/qr67qG5OCsifG1rMWYfh18RCDhsMFy9q2Py9ueVm10F6B x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: fbdcf32b-4ddd-4c32-cf01-08d57f8a9560 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB0902; x-ms-traffictypediagnostic: DM5PR2101MB0902: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(3231220)(944501229)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR2101MB0902; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0902; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(376002)(39380400002)(39860400002)(346002)(199004)(189003)(6116002)(72206003)(1076002)(3846002)(25786009)(2900100001)(36756003)(14454004)(316002)(3660700001)(6666003)(54906003)(110136005)(2950100002)(305945005)(7736002)(99286004)(5250100002)(86612001)(10090500001)(107886003)(66066001)(106356001)(2501003)(6512007)(6486002)(97736004)(6436002)(22452003)(68736007)(81166006)(8676002)(81156014)(53936002)(186003)(26005)(105586002)(3280700002)(8936002)(76176011)(478600001)(4326008)(10290500003)(575784001)(86362001)(5660300001)(2906002)(6506007)(102836004)(59450400001)(6346003)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0902; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: gf/7jronbk1qWDY7ykAy87w1O9yBSl6Qlrm47MvtuMy4pZ1VSENfbXZWbevkTknmnayRTooWzKbSeP2G8DJKi9u2Yr7Io9ThYrv2b2yng5apt1AUvs+D7/1tjsm01eVp0sz7WjN4Sq/9Snsbsamf7t/nufsH0SvvtqWoF+p5S5U= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <87E9F6C36D208948A3C3142ECFEAB40C@namprd21.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbdcf32b-4ddd-4c32-cf01-08d57f8a9560 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:38.9103 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0902 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit 7fc1503c906f0fac62d3506a6e993e49fb996248 ] 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] We have already checked that 'count' is larger than 0 here, so we know that 'ret' is initialized. Changing the 'for' loop into do/while also makes this clear to the compiler. Suggested-by: David Laight Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/cw1200/wsm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/cw1200/wsm.c b/drivers/net/wireless/cw1200/wsm.c index 9e0ca3048657..3dd46c78c1cc 100644 --- a/drivers/net/wireless/cw1200/wsm.c +++ b/drivers/net/wireless/cw1200/wsm.c @@ -379,7 +379,6 @@ static int wsm_multi_tx_confirm(struct cw1200_common *priv, { int ret; int count; - int i; count = WSM_GET32(buf); if (WARN_ON(count <= 0)) @@ -395,11 +394,10 @@ static int wsm_multi_tx_confirm(struct cw1200_common *priv, } cw1200_debug_txed_multi(priv, count); - for (i = 0; i < count; ++i) { + do { ret = wsm_tx_confirm(priv, buf, link_id); - if (ret) - return ret; - } + } while (!ret && --count); + return ret; underflow: