[openeuler:OLK-6.6 3560/3560] drivers/crypto/ccp/hygon/ccp-mdev.c:1144:15: warning: no previous prototype for function 'ccp_pin_memory'
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 04473ee9ed912a16fff0d8846ad565bbf3d63c77 commit: 592817a30ddc0ef43c7f5b5fe906ae37cf3bea3b [3560/3560] crypto: ccp: add ccp-mdev functionality to the ccp module. config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20251221/202512210422.Gfg4tcZV-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/202512210422.Gfg4tcZV-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/202512210422.Gfg4tcZV-lkp@intel.com/ All warnings (new ones prefixed by >>):
drivers/crypto/ccp/hygon/ccp-mdev.c:1144:15: warning: no previous prototype for function 'ccp_pin_memory' [-Wmissing-prototypes] 1144 | struct page **ccp_pin_memory(struct ccp_private *private, unsigned long uaddr, | ^ drivers/crypto/ccp/hygon/ccp-mdev.c:1144:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1144 | struct page **ccp_pin_memory(struct ccp_private *private, unsigned long uaddr, | ^ | static 1 warning generated.
vim +/ccp_pin_memory +1144 drivers/crypto/ccp/hygon/ccp-mdev.c 1143
1144 struct page **ccp_pin_memory(struct ccp_private *private, unsigned long uaddr, 1145 unsigned long ulen, unsigned long *n) 1146 { 1147 struct page **pages; 1148 unsigned long npages, size; 1149 unsigned long first, last; 1150 int npinned; 1151 1152 if (ulen == 0 || uaddr + ulen < uaddr) 1153 return NULL; 1154 1155 first = (uaddr & PAGE_MASK) >> PAGE_SHIFT; 1156 last = ((uaddr + ulen - 1) & PAGE_MASK) >> PAGE_SHIFT; 1157 npages = (last - first + 1); 1158 1159 if (WARN_ON_ONCE(npages > INT_MAX)) 1160 return NULL; 1161 1162 size = npages * sizeof(struct page *); 1163 if (size > PAGE_SIZE) 1164 pages = vmalloc(size); 1165 else 1166 pages = kmalloc(size, GFP_KERNEL); 1167 1168 if (!pages) 1169 return NULL; 1170 1171 /* Pin the user virtual address. */ 1172 npinned = pin_user_pages_fast(uaddr, npages, FOLL_WRITE, pages); 1173 if (npinned != npages) 1174 goto err; 1175 1176 *n = npages; 1177 return pages; 1178 1179 err: 1180 if (npinned > 0) 1181 unpin_user_pages(pages, npinned); 1182 kvfree(pages); 1183 return NULL; 1184 } 1185
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot