From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android15-6.6-2025-07 2/2] kernel/kallsyms.c:503:17: warning: 'strcpy' source argument is the same as destination
Date: Sat, 18 Jul 2026 07:58:01 +0800 [thread overview]
Message-ID: <202607180745.QGy1LHlp-lkp@intel.com> (raw)
Hi Arnd,
FYI, the error/warning still remains.
tree: https://android.googlesource.com/kernel/common android15-6.6-2025-07
head: 78af4078ece5032768bb0bc9282e26ca123d7679
commit: 26030cb984dd65e0cb2d0c2489d94941cf8897b4 [2/2] extrawarn: move -Wrestrict into W=1 warnings
config: arm64-randconfig-001-20260717 (https://download.01.org/0day-ci/archive/20260718/202607180745.QGy1LHlp-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260718/202607180745.QGy1LHlp-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
| Fixes: 26030cb984dd ("extrawarn: move -Wrestrict into W=1 warnings")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607180745.QGy1LHlp-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/kallsyms.c: In function '__sprint_symbol.constprop':
>> kernel/kallsyms.c:503:17: warning: 'strcpy' source argument is the same as destination [-Wrestrict]
503 | strcpy(buffer, name);
| ^~~~~~~~~~~~~~~~~~~~
vim +/strcpy +503 kernel/kallsyms.c
9d65cb4a1718a0 Alexey Dobriyan 2007-05-08 485
42e380832a6911 Robert Peterson 2007-04-30 486 /* Look up a kernel symbol and return it in a text buffer. */
0f77a8d378254f Namhyung Kim 2011-03-24 487 static int __sprint_symbol(char *buffer, unsigned long address,
9294523e376803 Stephen Boyd 2021-07-07 488 int symbol_offset, int add_offset, int add_buildid)
^1da177e4c3f41 Linus Torvalds 2005-04-16 489 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 490 char *modname;
9294523e376803 Stephen Boyd 2021-07-07 491 const unsigned char *buildid;
^1da177e4c3f41 Linus Torvalds 2005-04-16 492 const char *name;
^1da177e4c3f41 Linus Torvalds 2005-04-16 493 unsigned long offset, size;
966c8c12dc9e77 Hugh Dickins 2008-11-19 494 int len;
^1da177e4c3f41 Linus Torvalds 2005-04-16 495
0f77a8d378254f Namhyung Kim 2011-03-24 496 address += symbol_offset;
9294523e376803 Stephen Boyd 2021-07-07 497 name = kallsyms_lookup_buildid(address, &size, &offset, &modname, &buildid,
9294523e376803 Stephen Boyd 2021-07-07 498 buffer);
^1da177e4c3f41 Linus Torvalds 2005-04-16 499 if (!name)
b86280aa48b67c Namhyung Kim 2014-08-08 500 return sprintf(buffer, "0x%lx", address - symbol_offset);
19769b762607fe Andrew Morton 2007-07-15 501
966c8c12dc9e77 Hugh Dickins 2008-11-19 502 if (name != buffer)
966c8c12dc9e77 Hugh Dickins 2008-11-19 @503 strcpy(buffer, name);
966c8c12dc9e77 Hugh Dickins 2008-11-19 504 len = strlen(buffer);
0f77a8d378254f Namhyung Kim 2011-03-24 505 offset -= symbol_offset;
966c8c12dc9e77 Hugh Dickins 2008-11-19 506
4796dd200db943 Stephen Boyd 2012-05-29 507 if (add_offset)
4796dd200db943 Stephen Boyd 2012-05-29 508 len += sprintf(buffer + len, "+%#lx/%#lx", offset, size);
4796dd200db943 Stephen Boyd 2012-05-29 509
9294523e376803 Stephen Boyd 2021-07-07 510 if (modname) {
9294523e376803 Stephen Boyd 2021-07-07 511 len += sprintf(buffer + len, " [%s", modname);
9294523e376803 Stephen Boyd 2021-07-07 512 #if IS_ENABLED(CONFIG_STACKTRACE_BUILD_ID)
9294523e376803 Stephen Boyd 2021-07-07 513 if (add_buildid && buildid) {
9294523e376803 Stephen Boyd 2021-07-07 514 /* build ID should match length of sprintf */
9294523e376803 Stephen Boyd 2021-07-07 515 #if IS_ENABLED(CONFIG_MODULES)
9294523e376803 Stephen Boyd 2021-07-07 516 static_assert(sizeof(typeof_member(struct module, build_id)) == 20);
9294523e376803 Stephen Boyd 2021-07-07 517 #endif
9294523e376803 Stephen Boyd 2021-07-07 518 len += sprintf(buffer + len, " %20phN", buildid);
9294523e376803 Stephen Boyd 2021-07-07 519 }
9294523e376803 Stephen Boyd 2021-07-07 520 #endif
9294523e376803 Stephen Boyd 2021-07-07 521 len += sprintf(buffer + len, "]");
9294523e376803 Stephen Boyd 2021-07-07 522 }
966c8c12dc9e77 Hugh Dickins 2008-11-19 523
966c8c12dc9e77 Hugh Dickins 2008-11-19 524 return len;
^1da177e4c3f41 Linus Torvalds 2005-04-16 525 }
0f77a8d378254f Namhyung Kim 2011-03-24 526
:::::: The code at line 503 was first introduced by commit
:::::: 966c8c12dc9e77f931e2281ba25d2f0244b06949 sprint_symbol(): use less stack
:::::: TO: Hugh Dickins <hugh@veritas.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-07-17 23:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202607180745.QGy1LHlp-lkp@intel.com \
--to=lkp@intel.com \
--cc=cros-kernel-buildreports@googlegroups.com \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.