From: kernel test robot <yujie.liu@intel.com>
To: Jeff Xu <jeffxu@chromium.org>
Cc: <oe-kbuild-all@lists.linux.dev>,
Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 6378/6705] mseal_test.c:84:59: warning: format specifies type 'char *' but the argument has type 'char (*)[5]'
Date: Fri, 19 Apr 2024 09:16:12 +0800 [thread overview]
Message-ID: <202404190226.OfJOewV8-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 7b4f2bc91c15fdcf948bb2d9741a9d7d54303f8d
commit: 87c436bebeeb885b21f47a7dbcfc548e9679c688 [6378/6705] selftest mm/mseal memory sealing
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240419/202404190226.OfJOewV8-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 <yujie.liu@intel.com>
| Closes: https://lore.kernel.org/r/202404190226.OfJOewV8-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> mseal_test.c:84:59: warning: format specifies type 'char *' but the argument has type 'char (*)[5]' [-Wformat]
84 | if (sscanf(line, "%lx-%lx %4s", &addr_start, &addr_end, &protstr) == 3) {
| ~~~ ^~~~~~~~
1 warning generated.
vim +84 tools/testing/selftests/mm/mseal_test.c
87c436bebeeb88 Jeff Xu 2024-04-15 69
87c436bebeeb88 Jeff Xu 2024-04-15 70 static unsigned long get_vma_size(void *addr, int *prot)
87c436bebeeb88 Jeff Xu 2024-04-15 71 {
87c436bebeeb88 Jeff Xu 2024-04-15 72 FILE *maps;
87c436bebeeb88 Jeff Xu 2024-04-15 73 char line[256];
87c436bebeeb88 Jeff Xu 2024-04-15 74 int size = 0;
87c436bebeeb88 Jeff Xu 2024-04-15 75 uintptr_t addr_start, addr_end;
87c436bebeeb88 Jeff Xu 2024-04-15 76 char protstr[5];
87c436bebeeb88 Jeff Xu 2024-04-15 77 *prot = 0;
87c436bebeeb88 Jeff Xu 2024-04-15 78
87c436bebeeb88 Jeff Xu 2024-04-15 79 maps = fopen("/proc/self/maps", "r");
87c436bebeeb88 Jeff Xu 2024-04-15 80 if (!maps)
87c436bebeeb88 Jeff Xu 2024-04-15 81 return 0;
87c436bebeeb88 Jeff Xu 2024-04-15 82
87c436bebeeb88 Jeff Xu 2024-04-15 83 while (fgets(line, sizeof(line), maps)) {
87c436bebeeb88 Jeff Xu 2024-04-15 @84 if (sscanf(line, "%lx-%lx %4s", &addr_start, &addr_end, &protstr) == 3) {
87c436bebeeb88 Jeff Xu 2024-04-15 85 if (addr_start == (uintptr_t) addr) {
87c436bebeeb88 Jeff Xu 2024-04-15 86 size = addr_end - addr_start;
87c436bebeeb88 Jeff Xu 2024-04-15 87 if (protstr[0] == 'r')
87c436bebeeb88 Jeff Xu 2024-04-15 88 *prot |= 0x4;
87c436bebeeb88 Jeff Xu 2024-04-15 89 if (protstr[1] == 'w')
87c436bebeeb88 Jeff Xu 2024-04-15 90 *prot |= 0x2;
87c436bebeeb88 Jeff Xu 2024-04-15 91 if (protstr[2] == 'x')
87c436bebeeb88 Jeff Xu 2024-04-15 92 *prot |= 0x1;
87c436bebeeb88 Jeff Xu 2024-04-15 93 break;
87c436bebeeb88 Jeff Xu 2024-04-15 94 }
87c436bebeeb88 Jeff Xu 2024-04-15 95 }
87c436bebeeb88 Jeff Xu 2024-04-15 96 }
87c436bebeeb88 Jeff Xu 2024-04-15 97 fclose(maps);
87c436bebeeb88 Jeff Xu 2024-04-15 98 return size;
87c436bebeeb88 Jeff Xu 2024-04-15 99 }
87c436bebeeb88 Jeff Xu 2024-04-15 100
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-19 1:22 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=202404190226.OfJOewV8-lkp@intel.com \
--to=yujie.liu@intel.com \
--cc=akpm@linux-foundation.org \
--cc=jeffxu@chromium.org \
--cc=linux-mm@kvack.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox