From patchwork Wed Jul 24 06:21:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 261286 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 45D5E2C0795 for ; Wed, 24 Jul 2013 16:24:20 +1000 (EST) Received: from db9outboundpool.messaging.microsoft.com (mail-db9lp0253.outbound.messaging.microsoft.com [213.199.154.253]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "MSIT Machine Auth CA 2" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 535FE2C00FA for ; Wed, 24 Jul 2013 16:21:44 +1000 (EST) Received: from mail27-db9-R.bigfish.com (10.174.16.236) by DB9EHSOBE017.bigfish.com (10.174.14.80) with Microsoft SMTP Server id 14.1.225.22; Wed, 24 Jul 2013 06:21:39 +0000 Received: from mail27-db9 (localhost [127.0.0.1]) by mail27-db9-R.bigfish.com (Postfix) with ESMTP id 21CAB4008A; Wed, 24 Jul 2013 06:21:39 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 14 X-BigFish: VS14(zz67favzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h1de097h8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e23h1155h) Received: from mail27-db9 (localhost.localdomain [127.0.0.1]) by mail27-db9 (MessageSwitch) id 1374646896962724_28995; Wed, 24 Jul 2013 06:21:36 +0000 (UTC) Received: from DB9EHSMHS007.bigfish.com (unknown [10.174.16.237]) by mail27-db9.bigfish.com (Postfix) with ESMTP id E571C4E004B; Wed, 24 Jul 2013 06:21:36 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB9EHSMHS007.bigfish.com (10.174.14.17) with Microsoft SMTP Server (TLS) id 14.16.227.3; Wed, 24 Jul 2013 06:21:36 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.136.1; Wed, 24 Jul 2013 06:21:34 +0000 Received: from hongbo.ap.freescale.net (b45939-01.ap.freescale.net [10.193.20.52]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r6O6L0Wm003313; Tue, 23 Jul 2013 23:21:31 -0700 From: To: , , , , Subject: [PATCH v5 4/4] DMA: Freescale: eliminate a compiling warning Date: Wed, 24 Jul 2013 14:21:09 +0800 Message-ID: <1374646870-5162-5-git-send-email-hongbo.zhang@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374646870-5162-1-git-send-email-hongbo.zhang@freescale.com> References: <1374646870-5162-1-git-send-email-hongbo.zhang@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: Hongbo Zhang , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Hongbo Zhang The variable cookie is initialized in a list_for_each_entry loop, if(unlikely) the list is empty, this variable will be used uninitialized, so we get a gcc compiling warning about this. This patch fixes this defect by setting an initial value to the varialble cookie. Signed-off-by: Hongbo Zhang --- drivers/dma/fsldma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 16a9a48..14d68a4 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -406,7 +406,7 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx) struct fsl_desc_sw *desc = tx_to_fsl_desc(tx); struct fsl_desc_sw *child; unsigned long flags; - dma_cookie_t cookie; + dma_cookie_t cookie = 0; spin_lock_irqsave(&chan->desc_lock, flags);