All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, Christian Brauner <brauner@kernel.org>
Subject: [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'}
Date: Thu, 2 Jan 2025 22:29:26 +0800	[thread overview]
Message-ID: <202501022241.dIsZdFET-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-01-02 14:29 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=202501022241.dIsZdFET-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brauner@kernel.org \
    --cc=jlayton@kernel.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 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.