Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Benjamin Berg <benjamin@sipsolutions.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Johannes Berg <johannes.berg@intel.com>
Subject: [uml:next 24/27] arch/x86/um/tls_32.c:28:6: warning: variable 'cpu' set but not used
Date: Thu, 5 Jun 2025 00:58:13 +0800	[thread overview]
Message-ID: <202506050008.AwXLNxQX-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux next
head:   942349413a49670e8bed246e2185fd3a053227be
commit: 406d17c6c370a33cfb54067d9e205305293d4604 [24/27] um: Implement kernel side of SECCOMP based process handling
config: um-randconfig-002-20250604 (https://download.01.org/0day-ci/archive/20250605/202506050008.AwXLNxQX-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250605/202506050008.AwXLNxQX-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/202506050008.AwXLNxQX-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/um/tls_32.c:28:6: warning: variable 'cpu' set but not used [-Wunused-but-set-variable]
      28 |         u32 cpu;
         |             ^
   arch/x86/um/tls_32.c:129:19: warning: unused function 'needs_TLS_update' [-Wunused-function]
     129 | static inline int needs_TLS_update(struct task_struct *task)
         |                   ^~~~~~~~~~~~~~~~
   2 warnings generated.


vim +/cpu +28 arch/x86/um/tls_32.c

3feb88562d149f arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  24  
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  25  static int do_set_thread_area(struct task_struct* task, struct user_desc *info)
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  26  {
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  27  	int ret;
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31 @28  	u32 cpu;
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  29  
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  30  	if (info->entry_number < host_gdt_entry_tls_min ||
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  31  	    info->entry_number >= host_gdt_entry_tls_min + GDT_ENTRY_TLS_ENTRIES)
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  32  		return -EINVAL;
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  33  
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  34  	if (using_seccomp) {
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  35  		int idx = info->entry_number - host_gdt_entry_tls_min;
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  36  		struct stub_data *data = (void *)task->mm->context.id.stack;
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  37  
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  38  		data->arch_data.tls[idx] = *info;
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  39  		data->arch_data.sync |= BIT(idx);
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  40  
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  41  		return 0;
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  42  	}
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  43  
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  44  	cpu = get_cpu();
406d17c6c370a3 arch/x86/um/tls_32.c   Benjamin Berg                  2025-06-02  45  	ret = os_set_thread_area(info, task->mm->context.id.pid);
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  46  	put_cpu();
b8bec829c90d45 arch/um/sys-i386/tls.c Jeff Dike                      2008-02-04  47  
b8bec829c90d45 arch/um/sys-i386/tls.c Jeff Dike                      2008-02-04  48  	if (ret)
b8bec829c90d45 arch/um/sys-i386/tls.c Jeff Dike                      2008-02-04  49  		printk(KERN_ERR "PTRACE_SET_THREAD_AREA failed, err = %d, "
b8bec829c90d45 arch/um/sys-i386/tls.c Jeff Dike                      2008-02-04  50  		       "index = %d\n", ret, info->entry_number);
b8bec829c90d45 arch/um/sys-i386/tls.c Jeff Dike                      2008-02-04  51  
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  52  	return ret;
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  53  }
aa6758d4867cd0 arch/um/sys-i386/tls.c Paolo 'Blaisorblade' Giarrusso 2006-03-31  54  

:::::: The code at line 28 was first introduced by commit
:::::: aa6758d4867cd07bd76105ade6177fe6148e559a [PATCH] uml: implement {get,set}_thread_area for i386

:::::: TO: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
:::::: CC: Linus Torvalds <torvalds@g5.osdl.org>

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

                 reply	other threads:[~2025-06-04 17:00 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=202506050008.AwXLNxQX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=benjamin@sipsolutions.net \
    --cc=johannes.berg@intel.com \
    --cc=llvm@lists.linux.dev \
    --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