Skip to contentSkip to conversation

drivers/hid/hid-steelseries.c:599:1: warning: unused label 'srws1_remove'

PATCH New kernel test robot 2 participants 2 messages Sep 8, 2025 – Sep 12, 2025 HID

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   3e8e5822146bc396d2a7e5fbb7be13271665522a
commit: a84eeacbf9325fd7f604b80f246aaba157730cd5 [1042/7110] HID: steelseries: refactor probe() and remove()
config: um-randconfig-002-20250908 (https://download.01.org/0day-ci/archive/20250909/[email protected]/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 7fb1dc08d2f025aad5777bb779dfac1197e9ef87)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250909/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from drivers/hid/hid-steelseries.c:13:
In file included from include/linux/hid.h:29:
In file included from include/linux/hid_bpf.h:6:
In file included from include/linux/bpf.h:31:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:27:
In file included from include/linux/kernel_stat.h:8:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:12:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:1175:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1175 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^

>> drivers/hid/hid-steelseries.c:599:1: warning: unused label 'srws1_remove' [-Wunused-label]
     599 | srws1_remove:
         | ^~~~~~~~~~~~~

2 warnings generated.

vim +/srws1_remove +599 drivers/hid/hid-steelseries.c

576
577 static void steelseries_remove(struct hid_device *hdev)
578 {
579 struct steelseries_device *sd;
580 unsigned long flags;
581
582 if (hdev->product == USB_DEVICE_ID_STEELSERIES_SRWS1) {
583 #if IS_BUILTIN(CONFIG_LEDS_CLASS) || \
584 (IS_MODULE(CONFIG_LEDS_CLASS) && IS_MODULE(CONFIG_HID_STEELSERIES))
585 goto srws1_remove;
586 #endif
587 return;
588 }
589
590 sd = hid_get_drvdata(hdev);
591
592 spin_lock_irqsave(&sd->lock, flags);
593 sd->removed = true;
594 spin_unlock_irqrestore(&sd->lock, flags);
595
596 cancel_delayed_work_sync(&sd->battery_work);
597
598 hid_hw_close(hdev);

 > 599	srws1_remove:

600 hid_hw_stop(hdev);
601 }
602

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#1 lore raw

PATCH 1/1 HID: steelseries: Fix STEELSERIES_SRWS1 handling in steelseries_remove() (was [linux-next:master 1042/7110] drivers/hid/hid-steelseries.c:599:1: warning: unused label 'srws1_remove')

Quoted 31 lines · kernel test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   3e8e5822146bc396d2a7e5fbb7be13271665522a
commit: a84eeacbf9325fd7f604b80f246aaba157730cd5 [1042/7110] HID: steelseries: refactor probe() and remove()
config: um-randconfig-002-20250908 (https://download.01.org/0day-ci/archive/20250909/[email protected]/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 7fb1dc08d2f025aad5777bb779dfac1197e9ef87)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250909/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from drivers/hid/hid-steelseries.c:13:
In file included from include/linux/hid.h:29:
In file included from include/linux/hid_bpf.h:6:
In file included from include/linux/bpf.h:31:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:27:
In file included from include/linux/kernel_stat.h:8:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/um/include/asm/hardirq.h:5:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:12:
In file included from arch/um/include/asm/io.h:24:
include/asm-generic/io.h:1175:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
1175 | return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
| ~~~~~~~~~~ ^

Quoted 4 lines
Quoted 1 line
Quoted 1 line

drivers/hid/hid-steelseries.c:599:1: warning: unused label 'srws1_remove' [-Wunused-label]

     599 | srws1_remove:
         | ^~~~~~~~~~~~~

2 warnings generated.

[ adding CCs ]

From: Jiri Kosina <[email protected]>
Subject: [PATCH] HID: steelseries: Fix STEELSERIES_SRWS1 handling in steelseries_remove()

srws1_remove label can be only reached only if LEDS subsystem is enabled. To avoid putting horryfing ifdef second time around the label, just perform the cleanup and exit immediately directly.

Fixes a84eeacbf9325 ("HID: steelseries: refactor probe() and remove()")
---
 drivers/hid/hid-steelseries.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hid/hid-steelseries.c +1 -2
index 8af98d67959e..f98435631aa1 100644
@@ -582,7 +582,7 @@ static void steelseries_remove(struct hid_device *hdev)
 	if (hdev->product == USB_DEVICE_ID_STEELSERIES_SRWS1) {
 #if IS_BUILTIN(CONFIG_LEDS_CLASS) || \
     (IS_MODULE(CONFIG_LEDS_CLASS) && IS_MODULE(CONFIG_HID_STEELSERIES))
-		goto srws1_remove;
+		hid_hw_stop(hdev);
 #endif
 		return;
 	}
@@ -596,7 +596,6 @@ static void steelseries_remove(struct hid_device *hdev)
 	cancel_delayed_work_sync(&sd->battery_work);
 
 	hid_hw_close(hdev);
-srws1_remove:
 	hid_hw_stop(hdev);
 }
 
Signature · 2 lines
Jiri Kosina
SUSE Labs