From: kernel test robot <lkp@intel.com>
To: Pratyush Yadav <ptyadav@amazon.de>
Cc: oe-kbuild-all@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>
Subject: [akpm-mm:mm-nonmm-unstable 129/139] mm/shmem.c:5811:23: warning: unused variable 'flags'
Date: Sat, 8 Nov 2025 11:51:06 +0800 [thread overview]
Message-ID: <202511081101.9sXNBrzT-lkp@intel.com> (raw)
Hi Pratyush,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
head: 2fa523fd0829356881811ce9553b707102f55bd3
commit: 730fb8720d1ba209cd74692ece9766101e1fdb56 [129/139] mm: shmem: use SHMEM_F_* flags instead of VM_* flags
config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20251108/202511081101.9sXNBrzT-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251108/202511081101.9sXNBrzT-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/202511081101.9sXNBrzT-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/shmem.c: In function '__shmem_file_setup':
>> mm/shmem.c:5811:23: warning: unused variable 'flags' [-Wunused-variable]
5811 | unsigned long flags = (vm_flags & VM_NORESERVE) ? SHMEM_F_NORESERVE : 0;
| ^~~~~
vim +/flags +5811 mm/shmem.c
5806
5807 static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name,
5808 loff_t size, unsigned long vm_flags,
5809 unsigned int i_flags)
5810 {
> 5811 unsigned long flags = (vm_flags & VM_NORESERVE) ? SHMEM_F_NORESERVE : 0;
5812 struct inode *inode;
5813 struct file *res;
5814
5815 if (IS_ERR(mnt))
5816 return ERR_CAST(mnt);
5817
5818 if (size < 0 || size > MAX_LFS_FILESIZE)
5819 return ERR_PTR(-EINVAL);
5820
5821 if (is_idmapped_mnt(mnt))
5822 return ERR_PTR(-EINVAL);
5823
5824 if (shmem_acct_size(flags, size))
5825 return ERR_PTR(-ENOMEM);
5826
5827 inode = shmem_get_inode(&nop_mnt_idmap, mnt->mnt_sb, NULL,
5828 S_IFREG | S_IRWXUGO, 0, vm_flags);
5829 if (IS_ERR(inode)) {
5830 shmem_unacct_size(flags, size);
5831 return ERR_CAST(inode);
5832 }
5833 inode->i_flags |= i_flags;
5834 inode->i_size = size;
5835 clear_nlink(inode); /* It is unlinked */
5836 res = ERR_PTR(ramfs_nommu_expand_for_mapping(inode, size));
5837 if (!IS_ERR(res))
5838 res = alloc_file_pseudo(inode, mnt, name, O_RDWR,
5839 &shmem_file_operations);
5840 if (IS_ERR(res))
5841 iput(inode);
5842 return res;
5843 }
5844
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-11-08 3:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 3:51 kernel test robot [this message]
2025-11-08 16:43 ` Andrew Morton
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=202511081101.9sXNBrzT-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pasha.tatashin@soleen.com \
--cc=ptyadav@amazon.de \
/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