lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250205121244.322054-1-arnd@kernel.org>
Date: Wed,  5 Feb 2025 13:12:26 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Dave Penkler <dpenkler@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Arnd Bergmann <arnd@...db.de>,
	Dan Carpenter <dan.carpenter@...aro.org>,
	Nihar Chaithanya <niharchaithanya@...il.com>,
	Rohit Chavan <roheetchavan@...il.com>,
	linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Subject: [PATCH] gpib: mark pnp_device_id tables as __maybe_unused

From: Arnd Bergmann <arnd@...db.de>

This variable is not referenced in either of these two drivers driver,
causing a warning when they are built-in and W=1 warnings are enabled
with gcc:

drivers/staging/gpib/tnt4882/tnt4882_gpib.c:1507:35: error: 'tnt4882_pnp_table' defined but not used [-Werror=unused-const-variable=]
 1507 | static const struct pnp_device_id tnt4882_pnp_table[] = {
      |                                   ^~~~~~~~~~~~~~~~~
drivers/staging/gpib/hp_82341/hp_82341.c:811:35: error: 'hp_82341_pnp_table' defined but not used [-Werror=unused-const-variable=]
  811 | static const struct pnp_device_id hp_82341_pnp_table[] = {

The MODULE_DEVICE_TABLE() entry does have the effect of loading
the module when the PNP device is detected, so it is still needed
for the modular case.

Ideally the drivers should be converted to pnp_register_driver(),
which would lead to the ID table actually being used.

As a simpler workaround, add a __maybe_unused annotation to shut
up the warning.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/staging/gpib/hp_82341/hp_82341.c    | 2 +-
 drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpib/hp_82341/hp_82341.c
index 800f99c05566..7284311e04e2 100644
--- a/drivers/staging/gpib/hp_82341/hp_82341.c
+++ b/drivers/staging/gpib/hp_82341/hp_82341.c
@@ -808,7 +808,7 @@ static void hp_82341_detach(gpib_board_t *board)
 	hp_82341_free_private(board);
 }
 
-static const struct pnp_device_id hp_82341_pnp_table[] = {
+static __maybe_unused const struct pnp_device_id hp_82341_pnp_table[] = {
 	{.id = "HWP1411"},
 	{.id = ""}
 };
diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
index 2e1c3cbebaca..cf3b2a0eb93d 100644
--- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
+++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
@@ -1390,7 +1390,7 @@ static struct pci_driver tnt4882_pci_driver = {
 	.probe = &tnt4882_pci_probe
 };
 
-static const struct pnp_device_id tnt4882_pnp_table[] = {
+static __maybe_unused const struct pnp_device_id tnt4882_pnp_table[] = {
 	{.id = "NICC601"},
 	{.id = ""}
 };
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ