[openeuler:OLK-6.6 3542/3542] drivers/crypto/ccp/hygon/hct.c:1333:15: warning: no previous prototype for function 'hct_pin_memory'
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 04473ee9ed912a16fff0d8846ad565bbf3d63c77 commit: c74ae2c5da57becf3f41c596d79b3dd30fa1baa6 [3542/3542] hct: add mediated ccp driver support for hygon crypto technology. config: x86_64-randconfig-012-20251215 (https://download.01.org/0day-ci/archive/20251221/202512210747.245hMJvq-lkp@i...) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/202512210747.245hMJvq-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512210747.245hMJvq-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from drivers/crypto/ccp/hygon/hct.c:20: In file included from include/linux/vfio.h:12: In file included from include/linux/iommu.h:10: In file included from include/linux/scatterlist.h:8: In file included from include/linux/mm.h:2242: include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~
drivers/crypto/ccp/hygon/hct.c:1333:15: warning: no previous prototype for function 'hct_pin_memory' [-Wmissing-prototypes] 1333 | struct page **hct_pin_memory(struct hct_private *private, unsigned long uaddr, | ^ drivers/crypto/ccp/hygon/hct.c:1333:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1333 | struct page **hct_pin_memory(struct hct_private *private, unsigned long uaddr, | ^ | static drivers/crypto/ccp/hygon/hct.c:1730:45: error: no member named 'numa_node' in 'struct device' 1730 | *node = hct_data.iommu[page_idx].pdev->dev.numa_node; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ 2 warnings and 1 error generated.
vim +/hct_pin_memory +1333 drivers/crypto/ccp/hygon/hct.c 1332
1333 struct page **hct_pin_memory(struct hct_private *private, unsigned long uaddr, 1334 unsigned long ulen, unsigned long *n) 1335 { 1336 unsigned long npages, size; 1337 int npinned; 1338 struct page **pages; 1339 unsigned long first, last; 1340 1341 if (ulen == 0 || uaddr + ulen < uaddr) 1342 return NULL; 1343 1344 first = (uaddr & PAGE_MASK) >> PAGE_SHIFT; 1345 last = ((uaddr + ulen - 1) & PAGE_MASK) >> PAGE_SHIFT; 1346 npages = (last - first + 1); 1347 1348 if (WARN_ON_ONCE(npages > INT_MAX)) 1349 return NULL; 1350 1351 size = npages * sizeof(struct page *); 1352 if (size > PAGE_SIZE) 1353 pages = vmalloc(size); 1354 else 1355 pages = kmalloc(size, GFP_KERNEL); 1356 1357 if (!pages) 1358 return NULL; 1359 1360 /* Pin the user virtual address. */ 1361 npinned = pin_user_pages_fast(uaddr, npages, FOLL_WRITE, pages); 1362 if (npinned != npages) 1363 goto err; 1364 1365 *n = npages; 1366 return pages; 1367 1368 err: 1369 if (npinned > 0) 1370 unpin_user_pages(pages, npinned); 1371 kvfree(pages); 1372 return NULL; 1373 } 1374
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot