* [openeuler:OLK-6.6 13318/14350] drivers/crypto/ccp/hygon/tdm-dev.c:340:63: error: incomplete definition of type 'struct module'
@ 2024-10-11 4:54 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-11 4:54 UTC (permalink / raw)
To: kernel, chench00; +Cc: oe-kbuild-all
Hi chench00,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: f7c1291d7c3f15bc448cd93e29fa539386fe85fe
commit: a1dd4972da4e66d9a9d1a89b3dfd8f742c20193b [13318/14350] crypto: tdm: Add Hygon TDM driver
config: x86_64-buildonly-randconfig-003-20241011 (https://download.01.org/0day-ci/archive/20241011/202410111205.LRqw3beL-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241011/202410111205.LRqw3beL-lkp@intel.com/reproduce)
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/202410111205.LRqw3beL-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/crypto/ccp/hygon/tdm-dev.c:94:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
94 | int ret = 0;
| ^
>> drivers/crypto/ccp/hygon/tdm-dev.c:340:63: error: incomplete definition of type 'struct module'
340 | memcpy(ctx_msg.module_name, p_module->name, sizeof(p_module->name));
| ~~~~~~~~^
include/linux/fortify-string.h:707:53: note: expanded from macro 'memcpy'
707 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
| ^
include/linux/fortify-string.h:650:41: note: expanded from macro '__fortify_memcpy_chk'
650 | const size_t __fortify_size = (size_t)(size); \
| ^~~~
arch/x86/include/asm/alternative.h:103:8: note: forward declaration of 'struct module'
103 | struct module;
| ^
drivers/crypto/ccp/hygon/tdm-dev.c:340:40: error: incomplete definition of type 'struct module'
340 | memcpy(ctx_msg.module_name, p_module->name, sizeof(p_module->name));
| ~~~~~~~~^
include/linux/fortify-string.h:708:35: note: expanded from macro 'memcpy'
708 | __struct_size(p), __struct_size(q), \
| ^
include/linux/fortify-string.h:110:56: note: expanded from macro '__struct_size'
110 | #define __struct_size(p) __builtin_dynamic_object_size(p, 0)
| ^
include/linux/fortify-string.h:652:27: note: expanded from macro '__fortify_memcpy_chk'
652 | const size_t __q_size = (q_size); \
| ^~~~~~
arch/x86/include/asm/alternative.h:103:8: note: forward declaration of 'struct module'
103 | struct module;
| ^
drivers/crypto/ccp/hygon/tdm-dev.c:340:40: error: incomplete definition of type 'struct module'
340 | memcpy(ctx_msg.module_name, p_module->name, sizeof(p_module->name));
| ~~~~~~~~^
include/linux/fortify-string.h:709:35: note: expanded from macro 'memcpy'
709 | __member_size(p), __member_size(q), \
| ^
include/linux/fortify-string.h:111:56: note: expanded from macro '__member_size'
111 | #define __member_size(p) __builtin_dynamic_object_size(p, 1)
| ^
include/linux/fortify-string.h:654:33: note: expanded from macro '__fortify_memcpy_chk'
654 | const size_t __q_size_field = (q_size_field); \
| ^~~~~~~~~~~~
arch/x86/include/asm/alternative.h:103:8: note: forward declaration of 'struct module'
103 | struct module;
| ^
drivers/crypto/ccp/hygon/tdm-dev.c:340:40: error: incomplete definition of type 'struct module'
340 | memcpy(ctx_msg.module_name, p_module->name, sizeof(p_module->name));
| ~~~~~~~~^
include/linux/fortify-string.h:707:50: note: expanded from macro 'memcpy'
707 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \
| ^
include/linux/fortify-string.h:662:23: note: expanded from macro '__fortify_memcpy_chk'
662 | __underlying_##op(p, q, __fortify_size); \
| ^
arch/x86/include/asm/alternative.h:103:8: note: forward declaration of 'struct module'
103 | struct module;
| ^
drivers/crypto/ccp/hygon/tdm-dev.c:606:20: warning: variable 'head' set but not used [-Wunused-but-set-variable]
606 | struct list_head *head = NULL;
| ^
2 warnings and 4 errors generated.
vim +340 drivers/crypto/ccp/hygon/tdm-dev.c
323
324 if (!hash) {
325 ret = -DYN_NULL_POINTER;
326 pr_err("Null pointer\n");
327 goto end;
328 }
329
330 ctx_msg.flag = flag;
331 ctx_msg.pid = current->pid;
332 memcpy(ctx_msg.comm, current->comm, sizeof(current->comm));
333
334 return_address = CALLER_ADDR1;
335 if (return_address) {
336 #if IS_BUILTIN(CONFIG_CRYPTO_DEV_CCP_DD)
337 p_module = __module_address(return_address);
338 // caller is module
339 if (p_module)
> 340 memcpy(ctx_msg.module_name, p_module->name, sizeof(p_module->name));
341 // caller is build-in
342 else
343 memset(ctx_msg.module_name, 0, sizeof(ctx_msg.module_name));
344 #elif IS_ENABLED(CONFIG_KALLSYMS)
345 symbol_len = sprint_symbol((char *)symbol_buf, return_address);
346 if (!symbol_len) {
347 ret = -DYN_ERR_API;
348 pr_err("sprint_symbol failed\n");
349 goto end;
350 }
351 symbol_begin = strchr((char *)symbol_buf, '[');
352 if (!symbol_begin) {
353 ret = -DYN_NULL_POINTER;
354 pr_err("module name is not exist\n");
355 goto end;
356 }
357 symbol_end = strchr((char *)symbol_buf, ']');
358 if (!symbol_end) {
359 ret = -DYN_NULL_POINTER;
360 pr_err("module name is not exist\n");
361 goto end;
362 }
363 symbol_begin++;
364 if (symbol_end - symbol_begin)
365 memcpy(ctx_msg.module_name, symbol_begin, symbol_end - symbol_begin);
366 else
367 memset(ctx_msg.module_name, 0, sizeof(ctx_msg.module_name));
368 #else
369 memset(ctx_msg.module_name, 0, sizeof(ctx_msg.module_name));
370 #endif
371 } else
372 memset(ctx_msg.module_name, 0, sizeof(ctx_msg.module_name));
373
374 ret = calc_task_context_hash(ctx_msg, hash);
375 if (ret) {
376 pr_err("calc_task_context_hash failed\n");
377 goto end;
378 }
379
380 end:
381 return ret;
382 }
383
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-11 4:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 4:54 [openeuler:OLK-6.6 13318/14350] drivers/crypto/ccp/hygon/tdm-dev.c:340:63: error: incomplete definition of type 'struct module' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.