All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 774/5236] samples/vfs/mountinfo.c:142:29: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'}
@ 2025-01-02 14:29 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-01-02 14:29 UTC (permalink / raw)
  To: Jeff Layton; +Cc: oe-kbuild-all, Christian Brauner

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
commit: 0c8f746452aa75bbca927a9f5e9d0a7e69b892a4 [774/5236] samples: add a mountinfo program to demonstrate statmount()/listmount()
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20250102/202501022241.dIsZdFET-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250102/202501022241.dIsZdFET-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/202501022241.dIsZdFET-lkp@intel.com/

All warnings (new ones prefixed by >>):

   samples/vfs/mountinfo.c: In function 'dump_mountinfo':
>> samples/vfs/mountinfo.c:142:29: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
     142 |                 printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf->mnt_parent_id);
         |                           ~~^                 ~~~~~~~~~
         |                             |                 |
         |                             long unsigned int uint64_t {aka long long unsigned int}
         |                           %llx
   samples/vfs/mountinfo.c:142:35: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} [-Wformat=]
     142 |                 printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf->mnt_parent_id);
         |                                 ~~^                      ~~~~~~
         |                                   |                      |
         |                                   long unsigned int      uint64_t {aka long long unsigned int}
         |                                 %llx


vim +142 samples/vfs/mountinfo.c

   124	
   125	static int dump_mountinfo(uint64_t mnt_id, uint64_t mnt_ns_id)
   126	{
   127		int ret;
   128		struct statmount *buf = alloca(STATMOUNT_BUFSIZE);
   129		const uint64_t mask = STATMOUNT_SB_BASIC | STATMOUNT_MNT_BASIC |
   130					STATMOUNT_PROPAGATE_FROM | STATMOUNT_FS_TYPE |
   131					STATMOUNT_MNT_ROOT | STATMOUNT_MNT_POINT |
   132					STATMOUNT_MNT_OPTS | STATMOUNT_FS_SUBTYPE |
   133					STATMOUNT_SB_SOURCE;
   134	
   135		ret = statmount(mnt_id, mnt_ns_id, mask, buf, STATMOUNT_BUFSIZE, 0);
   136		if (ret < 0) {
   137			perror("statmount");
   138			return 1;
   139		}
   140	
   141		if (ext_format)
 > 142			printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf->mnt_parent_id);
   143	
   144		printf("%u %u %u:%u %s %s ", buf->mnt_id_old, buf->mnt_parent_id_old,
   145					   buf->sb_dev_major, buf->sb_dev_minor,
   146					   &buf->str[buf->mnt_root],
   147					   &buf->str[buf->mnt_point]);
   148		show_mnt_attrs(buf->mnt_attr);
   149		show_propagation(buf);
   150	
   151		printf(" - %s", &buf->str[buf->fs_type]);
   152		if (buf->mask & STATMOUNT_FS_SUBTYPE)
   153			printf(".%s", &buf->str[buf->fs_subtype]);
   154		if (buf->mask & STATMOUNT_SB_SOURCE)
   155			printf(" %s ", &buf->str[buf->sb_source]);
   156		else
   157			printf(" :none ");
   158	
   159		show_sb_flags(buf->sb_flags);
   160		if (buf->mask & STATMOUNT_MNT_OPTS)
   161			printf(",%s", &buf->str[buf->mnt_opts]);
   162		printf("\n");
   163		return 0;
   164	}
   165	

-- 
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:[~2025-01-02 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-02 14:29 [linux-next:master 774/5236] samples/vfs/mountinfo.c:142:29: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' {aka 'long long unsigned int'} 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.