From patchwork Wed Jan 13 21:25:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8028151 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 859C19F744 for ; Wed, 13 Jan 2016 21:26:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F14320524 for ; Wed, 13 Jan 2016 21:26:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B28F120522 for ; Wed, 13 Jan 2016 21:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753575AbcAMV0e (ORCPT ); Wed, 13 Jan 2016 16:26:34 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:62663 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbcAMV0T (ORCPT ); Wed, 13 Jan 2016 16:26:19 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MfYYl-1aYY7u3QOx-00P7gG; Wed, 13 Jan 2016 22:25:45 +0100 From: Arnd Bergmann To: Ulf Hansson Cc: Ian Molton , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, Kuninori Morimoto Subject: [PATCH] mmc: tmio_mmc_dma: don't print invalid DMA cookie Date: Wed, 13 Jan 2016 22:25:41 +0100 Message-ID: <5032992.kTQ6Oyibpy@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5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: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The tmio_mmc_start_dma_{rx,tx} function functions contain debug code that prints the dma cookie among other things. However, in case we fall back to PIO mode for some reason, the cookie variable is never initialized, and gcc warns about this: In file included from ../include/linux/printk.h:277:0, from ../include/linux/kernel.h:13, from ../include/linux/list.h:8, from ../include/linux/kobject.h:20, from ../include/linux/device.h:17, from ../drivers/mmc/host/tmio_mmc_dma.c:13: ../drivers/mmc/host/tmio_mmc_dma.c: In function 'tmio_mmc_start_dma': ../include/linux/dynamic_debug.h:86:3: warning: 'cookie' may be used uninitialized in this function [-Wmaybe-uninitialized] __dynamic_dev_dbg(&descriptor, dev, fmt, \ ^ ../drivers/mmc/host/tmio_mmc_dma.c:128:15: note: 'cookie' was declared here dma_cookie_t cookie; This modifies the dev_dbg() statements so we only print the cookie when we are already in the DMA path. Signed-off-by: Arnd Bergmann --- This warning has existed for a long time, and it's only in debug code, so probably nobody cared. -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c index e4b05dbb9ca8..4a0d6b80eaa3 100644 --- a/drivers/mmc/host/tmio_mmc_dma.c +++ b/drivers/mmc/host/tmio_mmc_dma.c @@ -94,9 +94,9 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host) desc = NULL; ret = cookie; } + dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n", + __func__, host->sg_len, ret, cookie, host->mrq); } - dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n", - __func__, host->sg_len, ret, cookie, host->mrq); pio: if (!desc) { @@ -116,8 +116,8 @@ pio: "DMA failed: %d, falling back to PIO\n", ret); } - dev_dbg(&host->pdev->dev, "%s(): desc %p, cookie %d, sg[%d]\n", __func__, - desc, cookie, host->sg_len); + dev_dbg(&host->pdev->dev, "%s(): desc %p, sg[%d]\n", __func__, + desc, host->sg_len); } static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) @@ -174,9 +174,9 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) desc = NULL; ret = cookie; } + dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n", + __func__, host->sg_len, ret, cookie, host->mrq); } - dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n", - __func__, host->sg_len, ret, cookie, host->mrq); pio: if (!desc) { @@ -196,8 +196,7 @@ pio: "DMA failed: %d, falling back to PIO\n", ret); } - dev_dbg(&host->pdev->dev, "%s(): desc %p, cookie %d\n", __func__, - desc, cookie); + dev_dbg(&host->pdev->dev, "%s(): desc %p\n", __func__, desc); } void tmio_mmc_start_dma(struct tmio_mmc_host *host,