Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: bcm2835: fix 64-bit warning

When building this driver on arm64, we get a harmless type
mismatch warning:

drivers/dma/bcm2835-dma.c: In function 'bcm2835_dma_fill_cb_chain_with_sg':
include/linux/kernel.h:743:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_min1 == &_min2); \
^
drivers/dma/bcm2835-dma.c:409:21: note: in expansion of macro 'min'
cb->cb->length = min(len, max_len);

This changes the type of the 'len' variable to size_t, which
avoids the problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 388cc7a281c0 ("dmaengine: bcm2835: add slave_sg support to bcm2835-dma")
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Arnd Bergmann and committed by
Vinod Koul
9a8d0efa 7d254559

+3 -2
+3 -2
drivers/dma/bcm2835-dma.c
··· 393 393 unsigned int sg_len) 394 394 { 395 395 struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); 396 - size_t max_len = bcm2835_dma_max_frame_length(c); 397 - unsigned int i, len; 396 + size_t len, max_len; 397 + unsigned int i; 398 398 dma_addr_t addr; 399 399 struct scatterlist *sgent; 400 400 401 + max_len = bcm2835_dma_max_frame_length(c); 401 402 for_each_sg(sgl, sgent, sg_len, i) { 402 403 for (addr = sg_dma_address(sgent), len = sg_dma_len(sgent); 403 404 len > 0;