Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdb11173 authored by Marek Szyprowski's avatar Marek Szyprowski
Browse files

ARM: dma-mapping: fix debug messages in dmabounce code



This patch fixes the usage of uninitialized variables in dmabounce code
intoduced by commit a227fb92 ('ARM: dma-mapping: remove offset parameter
to prepare for generic dma_ops'):
arch/arm/common/dmabounce.c: In function ‘dmabounce_sync_for_device’:
arch/arm/common/dmabounce.c:409: warning: ‘off’ may be used uninitialized in this function
arch/arm/common/dmabounce.c:407: note: ‘off’ was declared here
arch/arm/common/dmabounce.c: In function ‘dmabounce_sync_for_cpu’:
arch/arm/common/dmabounce.c:369: warning: ‘off’ may be used uninitialized in this function
arch/arm/common/dmabounce.c:367: note: ‘off’ was declared here

Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
parent 4986e5c7
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -366,8 +366,8 @@ static int __dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,
	struct safe_buffer *buf;
	struct safe_buffer *buf;
	unsigned long off;
	unsigned long off;


	dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n",
	dev_dbg(dev, "%s(dma=%#x,sz=%zx,dir=%x)\n",
		__func__, addr, off, sz, dir);
		__func__, addr, sz, dir);


	buf = find_safe_buffer_dev(dev, addr, __func__);
	buf = find_safe_buffer_dev(dev, addr, __func__);
	if (!buf)
	if (!buf)
@@ -377,8 +377,8 @@ static int __dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,


	BUG_ON(buf->direction != dir);
	BUG_ON(buf->direction != dir);


	dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
	dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x off=%#lx) mapped to %p (dma=%#x)\n",
		__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
		__func__, buf->ptr, virt_to_dma(dev, buf->ptr), off,
		buf->safe, buf->safe_dma_addr);
		buf->safe, buf->safe_dma_addr);


	DO_STATS(dev->archdata.dmabounce->bounce_count++);
	DO_STATS(dev->archdata.dmabounce->bounce_count++);
@@ -406,8 +406,8 @@ static int __dmabounce_sync_for_device(struct device *dev, dma_addr_t addr,
	struct safe_buffer *buf;
	struct safe_buffer *buf;
	unsigned long off;
	unsigned long off;


	dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n",
	dev_dbg(dev, "%s(dma=%#x,sz=%zx,dir=%x)\n",
		__func__, addr, off, sz, dir);
		__func__, addr, sz, dir);


	buf = find_safe_buffer_dev(dev, addr, __func__);
	buf = find_safe_buffer_dev(dev, addr, __func__);
	if (!buf)
	if (!buf)
@@ -417,8 +417,8 @@ static int __dmabounce_sync_for_device(struct device *dev, dma_addr_t addr,


	BUG_ON(buf->direction != dir);
	BUG_ON(buf->direction != dir);


	dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
	dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x off=%#lx) mapped to %p (dma=%#x)\n",
		__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
		__func__, buf->ptr, virt_to_dma(dev, buf->ptr), off,
		buf->safe, buf->safe_dma_addr);
		buf->safe, buf->safe_dma_addr);


	DO_STATS(dev->archdata.dmabounce->bounce_count++);
	DO_STATS(dev->archdata.dmabounce->bounce_count++);