From: Arnd Bergmann <arnd@arndb.de>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: ulf.hansson@linaro.org, tony@atomide.com, kishon@ti.com,
linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid random data
Date: Wed, 14 Sep 2016 12:23:20 +0200 [thread overview]
Message-ID: <3300411.hNyGPzA0ak@wuerfel> (raw)
In-Reply-To: <20160914101048.1061-1-peter.ujfalusi@ti.com>
On Wednesday, September 14, 2016 1:10:48 PM CEST Peter Ujfalusi wrote:
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 24ebc9a8de89..0a5640156159 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1409,7 +1409,7 @@ static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host,
> static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host,
> struct mmc_request *req)
> {
> - struct dma_slave_config cfg;
> + struct dma_slave_config cfg = {};
> struct dma_async_tx_descriptor *tx;
> int ret = 0, i;
> struct mmc_data *data = req->data;
>
This change looks correct and is certainly the simplest solution if you want to
get it into v4.8, but generally speaking, I think it would be nicer to combine
it with the initialization of the fields:
struct dma_slave_config cfg = {
.src_addr = host->mapbase + OMAP_HSMMC_DATA;
.dst_addr = host->mapbase + OMAP_HSMMC_DATA;
.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
.src_maxburst = data->blksz / 4;
.dst_maxburst = data->blksz / 4;
};
Arnd
next prev parent reply other threads:[~2016-09-14 10:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-14 10:10 [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid random data Peter Ujfalusi
2016-09-14 10:23 ` Arnd Bergmann [this message]
2016-09-14 10:52 ` Ulf Hansson
2016-09-14 10:59 ` Peter Ujfalusi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3300411.hNyGPzA0ak@wuerfel \
--to=arnd@arndb.de \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@ti.com \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox