Re: [PATCH 23/30] staging: mt7621-mmc: Remove initialisation in msdc_dma_config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 29 2018, Christian Lütke-Stetzkamp wrote:

> Current code initialises the variable sg at the beginning of the
> msdc_dma_config function. This is not necessary, because the variable
> is assigned by the for_each_sg macro later on.

But it isn't only used by the for_each_sg macro.

	switch (dma->mode) {
	case MSDC_MODE_DMA_BASIC:
		BUG_ON(host->xfer_size > 65535);
		BUG_ON(dma->sglen != 1);
		sdr_write32(MSDC_DMA_SA, PHYSADDR(sg_dma_address(sg)));

This now references an uninitialized variable, as do several other
places.

Maybe you could move the initialization into the MSDC_MODE_DMA_BASIC
case.


Thanks,
NeilBrown



>
> Signed-off-by: Christian Lütke-Stetzkamp <christian@xxxxxxxx>
> ---
>  drivers/staging/mt7621-mmc/sd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
> index a2dce54e386c..c9f0180f3220 100644
> --- a/drivers/staging/mt7621-mmc/sd.c
> +++ b/drivers/staging/mt7621-mmc/sd.c
> @@ -1091,7 +1091,7 @@ static int msdc_dma_config(struct msdc_host *host, struct msdc_dma *dma)
>  	void __iomem *base = host->base;
>  	//u32 i, j, num, bdlen, arg, xfersz;
>  	u32 j, num;
> -	struct scatterlist *sg = dma->sg;
> +	struct scatterlist *sg;
>  	struct gpd *gpd;
>  	struct bd *bd;
>  
> -- 
> 2.16.1

Attachment: signature.asc
Description: PGP signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux