Hi Claire,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.11-rc6 next-20210125]
[cannot apply to swiotlb/linux-next robh/for-next xen-tip/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Claire-Chang/Restricted-DMA/2021...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
61556703b610a104de324e4f061dc6cf7b218b46
config: arm-randconfig-r001-20210209 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
#
https://github.com/0day-ci/linux/commit/a766e1949e37b6b82605062e9ef9dd109...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review Claire-Chang/Restricted-DMA/20210209-142608
git checkout a766e1949e37b6b82605062e9ef9dd109d2ee940
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
kernel/dma/swiotlb.c:811:32: error: use of undeclared identifier 'reme'; did
you mean 'rmem'?
unsigned long pfn = PHYS_PFN(reme->base);
^~~~
rmem
include/linux/pfn.h:22:39: note: expanded from macro 'PHYS_PFN'
#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT))
^
kernel/dma/swiotlb.c:793:58: note: 'rmem' declared here
static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
^
> kernel/dma/swiotlb.c:811:17: warning: ISO C90 forbids mixing
declarations and code [-Wdeclaration-after-statement]
unsigned
long pfn = PHYS_PFN(reme->base);
^
1 warning and 1 error generated.
vim +811 kernel/dma/swiotlb.c
791
792 #ifdef CONFIG_DMA_RESTRICTED_POOL
793 static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
794 struct device *dev)
795 {
796 struct swiotlb *swiotlb = rmem->priv;
797 int ret;
798
799 if (dev->dev_swiotlb)
800 return -EBUSY;
801
802 /* Since multiple devices can share the same pool, the private data,
803 * swiotlb struct, will be initialized by the first device attached
804 * to it.
805 */
806 if (!swiotlb) {
807 swiotlb = kzalloc(sizeof(*swiotlb), GFP_KERNEL);
808 if (!swiotlb)
809 return -ENOMEM;
810 #ifdef CONFIG_ARM
811 unsigned long pfn = PHYS_PFN(reme->base);
812
813 if (!PageHighMem(pfn_to_page(pfn))) {
814 ret = -EINVAL;
815 goto cleanup;
816 }
817 #endif /* CONFIG_ARM */
818
819 ret = swiotlb_init_tlb_pool(swiotlb, rmem->base, rmem->size);
820 if (ret)
821 goto cleanup;
822
823 rmem->priv = swiotlb;
824 }
825
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org