lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1321891400.1516.215.camel@vkoul-udesk3>
Date:	Mon, 21 Nov 2011 21:33:20 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	dan.j.williams@...el.com, linux-kernel@...r.kernel.org,
	jaswinder.singh@...aro.org, 21cnbao@...il.com,
	rmk@....linux.org.uk, Russell King <rmk+kernel@....linux.org.uk>,
	Viresh Kumar <viresh.kumar@...com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	Mika Westerberg <mika.westerberg@....fi>,
	H Hartley Sweeten <hartleys@...ionengravers.com>,
	Li Yang <leoli@...escale.com>, Zhang Wei <zw@...kernel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	Shawn Guo <shawn.guo@...escale.com>,
	Yong Wang <yong.y.wang@...el.com>,
	Tomoya MORINAGA <tomoya-linux@....lapis-semi.com>,
	Boojin Kim <boojin.kim@...sung.com>,
	Barry Song <Baohua.Song@....com>
Subject: Re: [PATCH 02/10] dmaengine: move drivers to dma_transfer_direction

On Mon, 2011-11-21 at 15:20 +0300, Dan Carpenter wrote:
> I haven't followed this discussion at all so perhaps you were aware
> but this introduces a Sparse warning in linux-next.
> 
> drivers/dma/timb_dma.c:168:17: warning: mixing different enum types
> drivers/dma/timb_dma.c:168:17:     int enum dma_transfer_direction  versus
> drivers/dma/timb_dma.c:168:17:     int enum dma_data_direction 
> drivers/dma/timb_dma.c:172:32: warning: mixing different enum types
> drivers/dma/timb_dma.c:172:32:     int enum dma_transfer_direction  versus
> drivers/dma/timb_dma.c:172:32:     int enum dma_data_direction 

Thanks, below should fix this

diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 8c88072..d142ae1 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -166,10 +166,10 @@ static void __td_unmap_desc(struct timb_dma_chan *td_chan, const u8 *dma_desc,
 
 	if (single)
 		dma_unmap_single(chan2dev(&td_chan->chan), addr, len,
-			td_chan->direction);
+			DMA_TO_DEVICE);
 	else
 		dma_unmap_page(chan2dev(&td_chan->chan), addr, len,
-			td_chan->direction);
+			DMA_TO_DEVICE);
 }
 
 static void __td_unmap_descs(struct timb_dma_desc *td_desc, bool single)
@@ -398,7 +398,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan)
 	td_desc->txd.flags = DMA_CTRL_ACK;
 
 	td_desc->txd.phys = dma_map_single(chan2dmadev(chan),
-		td_desc->desc_list, td_desc->desc_list_len, DMA_MEM_TO_DEV);
+		td_desc->desc_list, td_desc->desc_list_len, DMA_TO_DEVICE);
 
 	err = dma_mapping_error(chan2dmadev(chan), td_desc->txd.phys);
 	if (err) {
@@ -419,7 +419,7 @@ static void td_free_desc(struct timb_dma_desc *td_desc)
 {
 	dev_dbg(chan2dev(td_desc->txd.chan), "Freeing desc: %p\n", td_desc);
 	dma_unmap_single(chan2dmadev(td_desc->txd.chan), td_desc->txd.phys,
-		td_desc->desc_list_len, DMA_MEM_TO_DEV);
+		td_desc->desc_list_len, DMA_TO_DEVICE);
 
 	kfree(td_desc->desc_list);
 	kfree(td_desc);



-- 
~Vinod

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ