Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1483157

Re: [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid random data

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid random data
Date 2016-09-14 12:30 +0200
Message-ID <shfC1-86s-27@gated-at.bofh.it> (permalink)
References <shfsm-830-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid random data Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-14 12:20 +0200
  Re: [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid random data Arnd Bergmann <arnd@arndb.de> - 2016-09-14 12:30 +0200
    Re: [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid  random data Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-09-14 13:00 +0200
    Re: [PATCH] mmc: omap_hsmmc: Initialize dma_slave_config to avoid  random data Ulf Hansson <ulf.hansson@linaro.org> - 2016-09-14 13:00 +0200

csiph-web