* [PATCH] scsi: buslogic: mark blogic_pci_tbl as __maybe_unused
@ 2025-07-30 21:44 Arnd Bergmann
2025-07-31 3:22 ` Martin K. Petersen
2025-07-31 3:55 ` Damien Le Moal
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2025-07-30 21:44 UTC (permalink / raw)
To: Khalid Aziz, James E.J. Bottomley, Martin K. Petersen,
Masahiro Yamada, Alexey Gladkov
Cc: Arnd Bergmann, Damien Le Moal, Geoff Levand, Christophe JAILLET,
Bart Van Assche, linux-scsi, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
A previous patch removed an #ifdef check around the array definition, but
this is not actually used when the driver is built-in, and now causes
a warning when -Wunused-const-variable is set:
drivers/scsi/BusLogic.c:3727:35: error: 'blogic_pci_tbl' defined but not used [-Werror=unused-const-variable=]
Mark it as __maybe_unused for this configuration.
Ideally this should be fixed instead by using the array as part of
a pci_driver definition, instead of the linux-2.4 style manual bus
scan.
Fixes: 204689f0ea20 ("scsi: Always define blogic_pci_tbl structure")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
There are only a handful of unused const variables left in the kernel,
and I would like to turn that warning on by default when they are
all gone.
---
drivers/scsi/BusLogic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 08e12a3d6703..82597bd96525 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -3724,7 +3724,7 @@ __setup("BusLogic=", blogic_setup);
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ }
};*/
-static const struct pci_device_id blogic_pci_tbl[] = {
+static const struct pci_device_id blogic_pci_tbl[] __maybe_unused = {
{PCI_DEVICE(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER)},
{PCI_DEVICE(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC)},
{PCI_DEVICE(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT)},
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: buslogic: mark blogic_pci_tbl as __maybe_unused
2025-07-30 21:44 [PATCH] scsi: buslogic: mark blogic_pci_tbl as __maybe_unused Arnd Bergmann
@ 2025-07-31 3:22 ` Martin K. Petersen
2025-07-31 3:55 ` Damien Le Moal
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-07-31 3:22 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Khalid Aziz, James E.J. Bottomley, Martin K. Petersen,
Masahiro Yamada, Alexey Gladkov, Arnd Bergmann, Damien Le Moal,
Geoff Levand, Christophe JAILLET, Bart Van Assche, linux-scsi,
linux-kernel
Hi Arnd!
> Fixes: 204689f0ea20 ("scsi: Always define blogic_pci_tbl structure")
This commit did not go through SCSI so Alexey will have to handle your
patch. But yes, I would like the scanning to be updated.
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: buslogic: mark blogic_pci_tbl as __maybe_unused
2025-07-30 21:44 [PATCH] scsi: buslogic: mark blogic_pci_tbl as __maybe_unused Arnd Bergmann
2025-07-31 3:22 ` Martin K. Petersen
@ 2025-07-31 3:55 ` Damien Le Moal
1 sibling, 0 replies; 3+ messages in thread
From: Damien Le Moal @ 2025-07-31 3:55 UTC (permalink / raw)
To: Arnd Bergmann, Khalid Aziz, James E.J. Bottomley,
Martin K. Petersen, Masahiro Yamada, Alexey Gladkov
Cc: Arnd Bergmann, Geoff Levand, Christophe JAILLET, Bart Van Assche,
linux-scsi, linux-kernel
On 7/31/25 6:44 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> A previous patch removed an #ifdef check around the array definition, but
> this is not actually used when the driver is built-in, and now causes
> a warning when -Wunused-const-variable is set:
>
> drivers/scsi/BusLogic.c:3727:35: error: 'blogic_pci_tbl' defined but not used [-Werror=unused-const-variable=]
>
> Mark it as __maybe_unused for this configuration.
>
> Ideally this should be fixed instead by using the array as part of
> a pci_driver definition, instead of the linux-2.4 style manual bus
> scan.
>
> Fixes: 204689f0ea20 ("scsi: Always define blogic_pci_tbl structure")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-31 3:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-30 21:44 [PATCH] scsi: buslogic: mark blogic_pci_tbl as __maybe_unused Arnd Bergmann
2025-07-31 3:22 ` Martin K. Petersen
2025-07-31 3:55 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).