Skip to contentSkip to conversation

comedi: ni_atmio: avoid warning for unused device_ids[] table

PATCH RESEND In review Arnd Bergmann 2 participants 2 messages Feb 25, 2025 Comedi drivers

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 comedi: ni_atmio: avoid warning for unused device_ids[] table

From: Arnd Bergmann <[email protected]>

When the driver is built-in, it produces a W=1 warning:

drivers/comedi/drivers/ni_atmio.c:209:35: error: 'device_ids' defined but not used [-Werror=unused-const-variable=]
209 | static const struct pnp_device_id device_ids[] = {

The actual probe() function has a different way of identifying the hardware, so just mark this one as __maybe_unused so it can be dropped when built-in.

---
I sent this a year ago but there were no comments, resending now without changes.

---
 drivers/comedi/drivers/ni_atmio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/comedi/drivers/ni_atmio.c +1 -1
index 330ae1c58800..b4e759e5703f 100644
@@ -215,7 +215,7 @@ static const int ni_irqpin[] = {
 
 #include "ni_mio_common.c"
 
-static const struct pnp_device_id device_ids[] = {
+static const struct pnp_device_id __maybe_unused device_ids[] = {
 	{.id = "NIC1900", .driver_data = 0},
 	{.id = "NIC2400", .driver_data = 0},
 	{.id = "NIC2500", .driver_data = 0},
Signature · 1 line
2.39.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When the driver is built-in, it produces a W=1 warning:

drivers/comedi/drivers/ni_atmio.c:209:35: error: 'device_ids' defined but not used [-Werror=unused-const-variable=]
209 | static const struct pnp_device_id device_ids[] = {

The actual probe() function has a different way of identifying the hardware, so just mark this one as __maybe_unused so it can be dropped when built-in.

---
I sent this a year ago but there were no comments, resending now without changes.

---
  drivers/comedi/drivers/ni_atmio.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/comedi/drivers/ni_atmio.c +0 -0
index 330ae1c58800..b4e759e5703f 100644

drivers/comedi/drivers/ni_atmio.c static const int ni_irqpin[] = { · line 221

Quoted 8 lines
drivers/comedi/drivers/ni_atmio.c +1 -1
@@ -215,7 +215,7 @@ static const int ni_irqpin[] = {
 
  #include "ni_mio_common.c"
 
-static const struct pnp_device_id device_ids[] = {
+static const struct pnp_device_id __maybe_unused device_ids[] = {
  	{.id = "NIC1900", .driver_data = 0},
  	{.id = "NIC2400", .driver_data = 0},
  	{.id = "NIC2500", .driver_data = 0},

Looks good, thanks!

(Greg, would you be kind enough to commit this to one of your trees if OK with it? Thanks.)

Signature · 4 lines
-=( Ian Abbott <[email protected]> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-