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: 9831503 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 4D16860317 for ; Sat, 8 Jul 2017 19:09:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DF802835B for ; Sat, 8 Jul 2017 19:09:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31721283BA; Sat, 8 Jul 2017 19:09:40 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A66352835B for ; Sat, 8 Jul 2017 19:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bHbO8hw5G9oN7hk1aHoUnAXP3gPw44KDKSRxXNrIlqk=; b=XEbp4dRnXxlmPG zYQKbgeuAHvOEiDkrBPie5ZBUboou5eh0UV2Ei0VSPt6DJiQzZphrHuXQJh81whx275LPhny0ODLM ygN9rYJhypAp9Ig/lYAo8JxpTzpRW8qt3DezglbikobBCIBFSX5RwGaIf9LMYOl9JfuwvC08IWgC8 1WBUU7uOIZ7fQes5ykM6KpNm+O1K2s79HPV3SZzM0a+n6Ve8ccSdFXsbO/LOYG1PulhnNKTbgSuSR Ca0mY7quXTP6uGVHvpiLRw7BmdqDixNG0h14IxXNlND7E1MR48TfduJecZkcXOtWOT8um7eBOndyV tVGyu/k4MDf9hroAuRBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dTv6W-0005MS-1N; Sat, 08 Jul 2017 19:09:20 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dTv6S-0005L5-Dy for ath10k@lists.infradead.org; Sat, 08 Jul 2017 19:09:18 +0000 Received: by mail-lf0-x243.google.com with SMTP id g21so6758160lfk.1 for ; Sat, 08 Jul 2017 12:08:54 -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=WbPs+2GSVMjb/nioBnd/MfhbvHOcoAih8tO6lYkKy8b1tWk7uMFcaOfuYtdru7kFdf KlyH3FnW9qS8F6DmIM1L1bCjs4g3HHpYIzTd3o3uBCp+iUFCyLERmzlM0eonSg1tiEk6 b6zVJGfpuyA7CjjhfgER2rK83tUKmqRp8rX5RnxQ4TI4ijSHeCmZ94cMy41gED3B0sh0 pKbhJZSNzZfNVC4vyKmMLDMbIaJQZvWU3LXhodp1v/gAq4tu2fxG3fEr0dJTxs6eJdHb lvWj4h4wINIPYNAuN0PIxluoqVpVBH233WO0swem4yV/yN6700W0JcfULFCLOyxGCNEl sVZw== X-Gm-Message-State: AIVw111iUsdAXrsNEPZQk3DD3macFouth3OO1hmhVWSx+BmGt0und+2d +JY17g892vCU/A== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170708_120916_686877_2D10443B X-CRM114-Status: UNSURE ( 9.90 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Stromdahl Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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);