Re: [PATCH 1/2] mtd: mtk-quadspi: add support for DMA reading
From: kbuild test robot
Date: Tue Nov 12 2019 - 03:06:55 EST
Hi Chuanhong,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on arm-soc/for-next]
[cannot apply to v5.4-rc7 next-20191108]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Chuanhong-Guo/mtd-mtk-quadspi-add-support-for-DMA-reading/20191112-145019
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git for-next
config: x86_64-randconfig-a004-201945 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
drivers/mtd/spi-nor/mtk-quadspi.c: In function 'mtk_nor_read_dma_bounce':
drivers/mtd/spi-nor/mtk-quadspi.c:349:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
mem_unaligned_len = (u32)buf % MTK_NOR_DMA_ALIGN;
^
In file included from include/linux/err.h:5:0,
from include/linux/clk.h:12,
from drivers/mtd/spi-nor/mtk-quadspi.c:7:
drivers/mtd/spi-nor/mtk-quadspi.c: In function 'mtk_nor_read':
drivers/mtd/spi-nor/mtk-quadspi.c:369:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(u32)buffer % MTK_NOR_DMA_ALIGN || from % MTK_NOR_DMA_ALIGN)
^
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> drivers/mtd/spi-nor/mtk-quadspi.c:368:2: note: in expansion of macro 'if'
if (object_is_on_stack(buffer) || !virt_addr_valid(buffer) ||
^~
drivers/mtd/spi-nor/mtk-quadspi.c:369:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(u32)buffer % MTK_NOR_DMA_ALIGN || from % MTK_NOR_DMA_ALIGN)
^
include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> drivers/mtd/spi-nor/mtk-quadspi.c:368:2: note: in expansion of macro 'if'
if (object_is_on_stack(buffer) || !virt_addr_valid(buffer) ||
^~
drivers/mtd/spi-nor/mtk-quadspi.c:369:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(u32)buffer % MTK_NOR_DMA_ALIGN || from % MTK_NOR_DMA_ALIGN)
^
include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value'
(cond) ? \
^~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~~~~~~~~~~~
>> drivers/mtd/spi-nor/mtk-quadspi.c:368:2: note: in expansion of macro 'if'
if (object_is_on_stack(buffer) || !virt_addr_valid(buffer) ||
^~
vim +/if +368 drivers/mtd/spi-nor/mtk-quadspi.c
359
360 static ssize_t mtk_nor_read(struct spi_nor *nor, loff_t from, size_t length,
361 u_char *buffer)
362 {
363 struct mtk_nor *mtk_nor = nor->priv;
364
365 if (length < MTK_NOR_DMA_ALIGN)
366 return mtk_nor_read_pio(mtk_nor, from, length, buffer);
367
> 368 if (object_is_on_stack(buffer) || !virt_addr_valid(buffer) ||
369 (u32)buffer % MTK_NOR_DMA_ALIGN || from % MTK_NOR_DMA_ALIGN)
370 return mtk_nor_read_dma_bounce(mtk_nor, from, length, buffer);
371
372 return mtk_nor_read_dma(mtk_nor, from, length, buffer);
373 }
374
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation
Attachment:
.config.gz
Description: application/gzip