All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
	linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, linux-kbuild@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com,
	ritesh.list@gmail.com, arnd@arndb.de, chleroy@kernel.org,
	Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Subject: Re: [PATCH v3] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning
Date: Thu, 2 Apr 2026 22:04:11 +0200	[thread overview]
Message-ID: <202604022248.LErLuuXd-lkp@intel.com> (raw)
In-Reply-To: <20260330062201.2581-1-venkat88@linux.ibm.com>

Hi Venkat,

kernel test robot noticed the following build errors:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on char-misc/char-misc-next char-misc/char-misc-linus linus/master v7.0-rc6 next-20260402]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Venkat-Rao-Bagalkote/char-nvram-Remove-unused-nvram_mutex-to-fix-Wunused-variable-warning/20260330-234134
base:   char-misc/char-misc-testing
patch link:    https://lore.kernel.org/r/20260330062201.2581-1-venkat88%40linux.ibm.com
patch subject: [PATCH v3] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260402/202604022248.LErLuuXd-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260402/202604022248.LErLuuXd-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/202604022248.LErLuuXd-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/char/nvram.c: In function 'nvram_misc_ioctl':
>> drivers/char/nvram.c:327:37: error: 'nvram_mutex' undeclared (first use in this function)
     327 |                         mutex_lock(&nvram_mutex);
         |                                     ^~~~~~~~~~~
   drivers/char/nvram.c:327:37: note: each undeclared identifier is reported only once for each function it appears in


vim +/nvram_mutex +327 drivers/char/nvram.c

^1da177e4c3f41 Linus Torvalds      2005-04-16  278  
cb8d8006d43f22 Finn Thain          2019-01-15  279  static long nvram_misc_ioctl(struct file *file, unsigned int cmd,
55929332c92e5d Arnd Bergmann       2010-04-27  280  			     unsigned long arg)
^1da177e4c3f41 Linus Torvalds      2005-04-16  281  {
2d58636e0af724 Finn Thain          2019-01-15  282  	long ret = -ENOTTY;
^1da177e4c3f41 Linus Torvalds      2005-04-16  283  
^1da177e4c3f41 Linus Torvalds      2005-04-16  284  	switch (cmd) {
95ac14b8a32817 Finn Thain          2019-01-15  285  #ifdef CONFIG_PPC
95ac14b8a32817 Finn Thain          2019-01-15  286  	case OBSOLETE_PMAC_NVRAM_GET_OFFSET:
95ac14b8a32817 Finn Thain          2019-01-15  287  		pr_warn("nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");
df561f6688fef7 Gustavo A. R. Silva 2020-08-23  288  		fallthrough;
95ac14b8a32817 Finn Thain          2019-01-15  289  	case IOC_NVRAM_GET_OFFSET:
95ac14b8a32817 Finn Thain          2019-01-15  290  		ret = -EINVAL;
95ac14b8a32817 Finn Thain          2019-01-15  291  #ifdef CONFIG_PPC_PMAC
95ac14b8a32817 Finn Thain          2019-01-15  292  		if (machine_is(powermac)) {
95ac14b8a32817 Finn Thain          2019-01-15  293  			int part, offset;
95ac14b8a32817 Finn Thain          2019-01-15  294  
95ac14b8a32817 Finn Thain          2019-01-15  295  			if (copy_from_user(&part, (void __user *)arg,
95ac14b8a32817 Finn Thain          2019-01-15  296  					   sizeof(part)) != 0)
95ac14b8a32817 Finn Thain          2019-01-15  297  				return -EFAULT;
95ac14b8a32817 Finn Thain          2019-01-15  298  			if (part < pmac_nvram_OF || part > pmac_nvram_NR)
95ac14b8a32817 Finn Thain          2019-01-15  299  				return -EINVAL;
95ac14b8a32817 Finn Thain          2019-01-15  300  			offset = pmac_get_partition(part);
20e07af71f34d9 Finn Thain          2019-01-15  301  			if (offset < 0)
20e07af71f34d9 Finn Thain          2019-01-15  302  				return -EINVAL;
95ac14b8a32817 Finn Thain          2019-01-15  303  			if (copy_to_user((void __user *)arg,
95ac14b8a32817 Finn Thain          2019-01-15  304  					 &offset, sizeof(offset)) != 0)
95ac14b8a32817 Finn Thain          2019-01-15  305  				return -EFAULT;
95ac14b8a32817 Finn Thain          2019-01-15  306  			ret = 0;
95ac14b8a32817 Finn Thain          2019-01-15  307  		}
95ac14b8a32817 Finn Thain          2019-01-15  308  #endif
95ac14b8a32817 Finn Thain          2019-01-15  309  		break;
20e07af71f34d9 Finn Thain          2019-01-15  310  #ifdef CONFIG_PPC32
95ac14b8a32817 Finn Thain          2019-01-15  311  	case IOC_NVRAM_SYNC:
95ac14b8a32817 Finn Thain          2019-01-15  312  		if (ppc_md.nvram_sync != NULL) {
95ac14b8a32817 Finn Thain          2019-01-15  313  			mutex_lock(&nvram_mutex);
95ac14b8a32817 Finn Thain          2019-01-15  314  			ppc_md.nvram_sync();
95ac14b8a32817 Finn Thain          2019-01-15  315  			mutex_unlock(&nvram_mutex);
95ac14b8a32817 Finn Thain          2019-01-15  316  		}
95ac14b8a32817 Finn Thain          2019-01-15  317  		ret = 0;
95ac14b8a32817 Finn Thain          2019-01-15  318  		break;
20e07af71f34d9 Finn Thain          2019-01-15  319  #endif
95ac14b8a32817 Finn Thain          2019-01-15  320  #elif defined(CONFIG_X86) || defined(CONFIG_M68K)
^1da177e4c3f41 Linus Torvalds      2005-04-16  321  	case NVRAM_INIT:
^1da177e4c3f41 Linus Torvalds      2005-04-16  322  		/* initialize NVRAM contents and checksum */
^1da177e4c3f41 Linus Torvalds      2005-04-16  323  		if (!capable(CAP_SYS_ADMIN))
^1da177e4c3f41 Linus Torvalds      2005-04-16  324  			return -EACCES;
^1da177e4c3f41 Linus Torvalds      2005-04-16  325  
2d58636e0af724 Finn Thain          2019-01-15  326  		if (arch_nvram_ops.initialize != NULL) {
613655fa39ff69 Arnd Bergmann       2010-06-02 @327  			mutex_lock(&nvram_mutex);
2d58636e0af724 Finn Thain          2019-01-15  328  			ret = arch_nvram_ops.initialize();
613655fa39ff69 Arnd Bergmann       2010-06-02  329  			mutex_unlock(&nvram_mutex);
2d58636e0af724 Finn Thain          2019-01-15  330  		}
2d58636e0af724 Finn Thain          2019-01-15  331  		break;
^1da177e4c3f41 Linus Torvalds      2005-04-16  332  	case NVRAM_SETCKS:
^1da177e4c3f41 Linus Torvalds      2005-04-16  333  		/* just set checksum, contents unchanged (maybe useful after
^1da177e4c3f41 Linus Torvalds      2005-04-16  334  		 * checksum garbaged somehow...) */
^1da177e4c3f41 Linus Torvalds      2005-04-16  335  		if (!capable(CAP_SYS_ADMIN))
^1da177e4c3f41 Linus Torvalds      2005-04-16  336  			return -EACCES;
^1da177e4c3f41 Linus Torvalds      2005-04-16  337  
2d58636e0af724 Finn Thain          2019-01-15  338  		if (arch_nvram_ops.set_checksum != NULL) {
613655fa39ff69 Arnd Bergmann       2010-06-02  339  			mutex_lock(&nvram_mutex);
2d58636e0af724 Finn Thain          2019-01-15  340  			ret = arch_nvram_ops.set_checksum();
613655fa39ff69 Arnd Bergmann       2010-06-02  341  			mutex_unlock(&nvram_mutex);
^1da177e4c3f41 Linus Torvalds      2005-04-16  342  		}
2d58636e0af724 Finn Thain          2019-01-15  343  		break;
95ac14b8a32817 Finn Thain          2019-01-15  344  #endif /* CONFIG_X86 || CONFIG_M68K */
2d58636e0af724 Finn Thain          2019-01-15  345  	}
2d58636e0af724 Finn Thain          2019-01-15  346  	return ret;
^1da177e4c3f41 Linus Torvalds      2005-04-16  347  }
^1da177e4c3f41 Linus Torvalds      2005-04-16  348  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2026-04-02 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  6:22 [PATCH v3] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning Venkat Rao Bagalkote
2026-03-30  6:42 ` Ritesh Harjani
2026-04-02 20:04 ` kernel test robot [this message]

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=202604022248.LErLuuXd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=chleroy@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ritesh.list@gmail.com \
    --cc=venkat88@linux.ibm.com \
    /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.