From patchwork Sat Jul 8 19:08:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9831499 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 D125260317 for ; Sat, 8 Jul 2017 19:09:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C000B2835B for ; Sat, 8 Jul 2017 19:09:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFA2D283C3; Sat, 8 Jul 2017 19:09:06 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham 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 4215F2835B for ; Sat, 8 Jul 2017 19:09:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753149AbdGHTIz (ORCPT ); Sat, 8 Jul 2017 15:08:55 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33664 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbdGHTIy (ORCPT ); Sat, 8 Jul 2017 15:08:54 -0400 Received: by mail-lf0-f65.google.com with SMTP id t72so6785536lff.0; Sat, 08 Jul 2017 12:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Lq7DY/RDGdtP0vEHPMV4lrukUelwBtxsozgEvlUSAE=; b=h98uAaGH8emxR2zuXC02mxdsFhiIp+RP/L0ThuHvloDptCHgynzCrIRndmFvwBOjwH arlrnyI4gEVt1SCIY5AjDYxqiB5fX6obj4sT2y73eGJ7gvZ2yJt6Df9W7G90vTVHsFsR Gek+wq/CNh5RkbNOogewcioXFr3PGfOxB3DOZdDQz51w/41F6j09R/wncyg3bX3bOTqU GvLhZunZsszCItLYOOKUZ0evXksb8mVqN7rc1k4iJRZpjvU83l3ReMTUhvremcpKuAqo KotXvnIEAILzdBCi3Bci4Gb9fO4v8GfalFwfjkuLxL1mRNtGeJCIh+zGCyj6c1hJFwrL Cktg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Lq7DY/RDGdtP0vEHPMV4lrukUelwBtxsozgEvlUSAE=; b=lty8NodwZnK73VseDxJ5DAcBp7tsDyBiV80WlFz+bC+wzaxfTHPyE2AvbqzP1zaTdP Ikf1F3cEqHjT9xcaacnqgkoimCOELWg/mkdu+dRe+a0C0CaHOeKAS1gu1GJQZZ6+p4lO 3h3SyPPbPYJ4bpIeV0E6eXeS3k6dBPM0sNK16Os6uO3QtCVp7QLwrsFTpLfgRDopftjj HmUCnM2EtVfZordcU8PB8xb7qd3tjuiSMKoGEuKUrATz6bcp63cgR4q5Pg7p6WhE3zDP 65du40FUXN4Pn/7f8/0OKTYZyyF2V19zDjczmuhqKrmswN/gx57ujQVgHdaDEsnwC4Wq MzQA== X-Gm-Message-State: AIVw110C5yFLwPredjXTxGxzSfPGkkK9GTctCIdkxcbjzH5SKdVBynnT Ec4svTgWaqHetw== X-Received: by 10.46.21.21 with SMTP id s21mr2175907ljd.118.1499540932603; Sat, 08 Jul 2017 12:08:52 -0700 (PDT) Received: from erik-mate-1604.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id r203sm1553016lff.67.2017.07.08.12.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 08 Jul 2017 12:08:51 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Erik Stromdahl Subject: [PATCH] ath10k: sdio: fix compile warning Date: Sat, 8 Jul 2017 21:08:41 +0200 Message-Id: <1499540921-18521-1-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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 As suggested by Arnd Bergmann, replace "while (time_before_...) {}" with "do {} while (time_before_...)" This fixes the following warnings detected by gcc 4.1.2: drivers/net/wireless/ath/ath10k/sdio.c: In function ‘ath10k_sdio_mbox_rxmsg_pending_handler’: drivers/net/wireless/ath/ath10k/sdio.c:676: warning: ‘ret’ may be used uninitialized in this function ... drivers/net/wireless/ath/ath10k/sdio.c: In function ‘ath10k_sdio_irq_handler’: drivers/net/wireless/ath/ath10k/sdio.c:1331: warning: ‘ret’ may be used uninitialized in this function Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/sdio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index 859ed87..48268f0 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -683,7 +683,7 @@ static int ath10k_sdio_mbox_rxmsg_pending_handler(struct ath10k *ar, lookaheads[0] = msg_lookahead; timeout = jiffies + SDIO_MBOX_PROCESSING_TIMEOUT_HZ; - while (time_before(jiffies, timeout)) { + do { /* Try to allocate as many HTC RX packets indicated by * n_lookaheads. */ @@ -719,7 +719,7 @@ static int ath10k_sdio_mbox_rxmsg_pending_handler(struct ath10k *ar, * performance in high throughput situations. */ *done = false; - } + } while (time_before(jiffies, timeout)); if (ret && (ret != -ECANCELED)) ath10k_warn(ar, "failed to get pending recv messages: %d\n", @@ -1336,11 +1336,11 @@ static void ath10k_sdio_irq_handler(struct sdio_func *func) sdio_release_host(ar_sdio->func); timeout = jiffies + ATH10K_SDIO_HIF_COMMUNICATION_TIMEOUT_HZ; - while (time_before(jiffies, timeout) && !done) { + do { ret = ath10k_sdio_mbox_proc_pending_irqs(ar, &done); if (ret) break; - } + } while (time_before(jiffies, timeout) && !done); sdio_claim_host(ar_sdio->func);