* [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
@ 2024-04-03 8:06 ` Arnd Bergmann
2024-04-03 8:29 ` Damien Le Moal
` (2 more replies)
2024-04-06 5:20 ` [PATCH 00/34] address all -Wunused-const warnings patchwork-bot+netdevbpf
` (3 subsequent siblings)
4 siblings, 3 replies; 11+ messages in thread
From: Arnd Bergmann @ 2024-04-03 8:06 UTC (permalink / raw)
To: linux-kernel, Damien Le Moal, Niklas Cassel, Saeed Bishara
Cc: Arnd Bergmann, Ma Ke, Uwe Kleine-König, Sergey Shtylyov,
Christophe JAILLET, Jeff Garzik, linux-ide
From: Arnd Bergmann <arnd@arndb.de>
Building with W=1 shows a warning for an unused variable when CONFIG_PCI
is diabled:
drivers/ata/sata_mv.c:790:35: error: unused variable 'mv_pci_tbl' [-Werror,-Wunused-const-variable]
static const struct pci_device_id mv_pci_tbl[] = {
Move the table into the same block that containsn the pci_driver
definition.
Fixes: 7bb3c5290ca0 ("sata_mv: Remove PCI dependency")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/ata/sata_mv.c | 64 +++++++++++++++++++++----------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index e82786c63fbd..697063890f5d 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -787,37 +787,6 @@ static const struct ata_port_info mv_port_info[] = {
},
};
-static const struct pci_device_id mv_pci_tbl[] = {
- { PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
- { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
- { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
- { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
- /* RocketRAID 1720/174x have different identifiers */
- { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
- { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
- { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
-
- { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
- { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
- { PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
- { PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
- { PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
-
- { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
-
- /* Adaptec 1430SA */
- { PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
-
- /* Marvell 7042 support */
- { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
-
- /* Highpoint RocketRAID PCIe series */
- { PCI_VDEVICE(TTI, 0x2300), chip_7042 },
- { PCI_VDEVICE(TTI, 0x2310), chip_7042 },
-
- { } /* terminate list */
-};
-
static const struct mv_hw_ops mv5xxx_ops = {
.phy_errata = mv5_phy_errata,
.enable_leds = mv5_enable_leds,
@@ -4303,6 +4272,37 @@ static int mv_pci_init_one(struct pci_dev *pdev,
static int mv_pci_device_resume(struct pci_dev *pdev);
#endif
+static const struct pci_device_id mv_pci_tbl[] = {
+ { PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
+ { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
+ { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
+ { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
+ /* RocketRAID 1720/174x have different identifiers */
+ { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
+ { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
+ { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
+
+ { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
+ { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
+ { PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
+ { PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
+ { PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
+
+ { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
+
+ /* Adaptec 1430SA */
+ { PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
+
+ /* Marvell 7042 support */
+ { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
+
+ /* Highpoint RocketRAID PCIe series */
+ { PCI_VDEVICE(TTI, 0x2300), chip_7042 },
+ { PCI_VDEVICE(TTI, 0x2310), chip_7042 },
+
+ { } /* terminate list */
+};
+
static struct pci_driver mv_pci_driver = {
.name = DRV_NAME,
@@ -4315,6 +4315,7 @@ static struct pci_driver mv_pci_driver = {
#endif
};
+MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
/**
* mv_print_info - Dump key info to kernel log for perusal.
@@ -4487,7 +4488,6 @@ static void __exit mv_exit(void)
MODULE_AUTHOR("Brett Russ");
MODULE_DESCRIPTION("SCSI low-level driver for Marvell SATA controllers");
MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
MODULE_VERSION(DRV_VERSION);
MODULE_ALIAS("platform:" DRV_NAME);
--
2.39.2
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks
2024-04-03 8:06 ` [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks Arnd Bergmann
@ 2024-04-03 8:29 ` Damien Le Moal
2024-04-03 8:32 ` Damien Le Moal
2024-04-03 9:10 ` Andy Shevchenko
2 siblings, 0 replies; 11+ messages in thread
From: Damien Le Moal @ 2024-04-03 8:29 UTC (permalink / raw)
To: Arnd Bergmann, linux-kernel, Niklas Cassel, Saeed Bishara
Cc: Arnd Bergmann, Ma Ke, Uwe Kleine-König, Sergey Shtylyov,
Christophe JAILLET, Jeff Garzik, linux-ide
On 4/3/24 17:06, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building with W=1 shows a warning for an unused variable when CONFIG_PCI
> is diabled:
s/diabled/disabled
> drivers/ata/sata_mv.c:790:35: error: unused variable 'mv_pci_tbl' [-Werror,-Wunused-const-variable]
> static const struct pci_device_id mv_pci_tbl[] = {
>
> Move the table into the same block that containsn the pci_driver
> definition.
s/containsn/contains
But no need to resend, I will fix that when applying.
Thanks !
>
> Fixes: 7bb3c5290ca0 ("sata_mv: Remove PCI dependency")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/ata/sata_mv.c | 64 +++++++++++++++++++++----------------------
> 1 file changed, 32 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index e82786c63fbd..697063890f5d 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -787,37 +787,6 @@ static const struct ata_port_info mv_port_info[] = {
> },
> };
>
> -static const struct pci_device_id mv_pci_tbl[] = {
> - { PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
> - { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
> - { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
> - { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
> - /* RocketRAID 1720/174x have different identifiers */
> - { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
> - { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
> - { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
> -
> - { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
> - { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
> - { PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
> - { PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
> - { PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
> -
> - { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
> -
> - /* Adaptec 1430SA */
> - { PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
> -
> - /* Marvell 7042 support */
> - { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
> -
> - /* Highpoint RocketRAID PCIe series */
> - { PCI_VDEVICE(TTI, 0x2300), chip_7042 },
> - { PCI_VDEVICE(TTI, 0x2310), chip_7042 },
> -
> - { } /* terminate list */
> -};
> -
> static const struct mv_hw_ops mv5xxx_ops = {
> .phy_errata = mv5_phy_errata,
> .enable_leds = mv5_enable_leds,
> @@ -4303,6 +4272,37 @@ static int mv_pci_init_one(struct pci_dev *pdev,
> static int mv_pci_device_resume(struct pci_dev *pdev);
> #endif
>
> +static const struct pci_device_id mv_pci_tbl[] = {
> + { PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
> + { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
> + { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
> + { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
> + /* RocketRAID 1720/174x have different identifiers */
> + { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
> + { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
> + { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
> +
> + { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
> + { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
> + { PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
> + { PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
> + { PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
> +
> + { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
> +
> + /* Adaptec 1430SA */
> + { PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
> +
> + /* Marvell 7042 support */
> + { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
> +
> + /* Highpoint RocketRAID PCIe series */
> + { PCI_VDEVICE(TTI, 0x2300), chip_7042 },
> + { PCI_VDEVICE(TTI, 0x2310), chip_7042 },
> +
> + { } /* terminate list */
> +};
> +
>
> static struct pci_driver mv_pci_driver = {
> .name = DRV_NAME,
> @@ -4315,6 +4315,7 @@ static struct pci_driver mv_pci_driver = {
> #endif
>
> };
> +MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
>
> /**
> * mv_print_info - Dump key info to kernel log for perusal.
> @@ -4487,7 +4488,6 @@ static void __exit mv_exit(void)
> MODULE_AUTHOR("Brett Russ");
> MODULE_DESCRIPTION("SCSI low-level driver for Marvell SATA controllers");
> MODULE_LICENSE("GPL v2");
> -MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
> MODULE_VERSION(DRV_VERSION);
> MODULE_ALIAS("platform:" DRV_NAME);
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks
2024-04-03 8:06 ` [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks Arnd Bergmann
2024-04-03 8:29 ` Damien Le Moal
@ 2024-04-03 8:32 ` Damien Le Moal
2024-04-03 8:50 ` Arnd Bergmann
2024-04-03 9:10 ` Andy Shevchenko
2 siblings, 1 reply; 11+ messages in thread
From: Damien Le Moal @ 2024-04-03 8:32 UTC (permalink / raw)
To: Arnd Bergmann, linux-kernel, Niklas Cassel, Saeed Bishara
Cc: Arnd Bergmann, Ma Ke, Uwe Kleine-König, Sergey Shtylyov,
Christophe JAILLET, Jeff Garzik, linux-ide
On 4/3/24 17:06, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building with W=1 shows a warning for an unused variable when CONFIG_PCI
> is diabled:
>
> drivers/ata/sata_mv.c:790:35: error: unused variable 'mv_pci_tbl' [-Werror,-Wunused-const-variable]
> static const struct pci_device_id mv_pci_tbl[] = {
>
> Move the table into the same block that containsn the pci_driver
> definition.
>
> Fixes: 7bb3c5290ca0 ("sata_mv: Remove PCI dependency")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
The patch title is also not describing what the patch does.
Are you OK with changing that to:
ata: sata_mv: Fix PCI device ID table declaration warning
?
> ---
> drivers/ata/sata_mv.c | 64 +++++++++++++++++++++----------------------
> 1 file changed, 32 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
> index e82786c63fbd..697063890f5d 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -787,37 +787,6 @@ static const struct ata_port_info mv_port_info[] = {
> },
> };
>
> -static const struct pci_device_id mv_pci_tbl[] = {
> - { PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
> - { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
> - { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
> - { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
> - /* RocketRAID 1720/174x have different identifiers */
> - { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
> - { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
> - { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
> -
> - { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
> - { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
> - { PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
> - { PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
> - { PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
> -
> - { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
> -
> - /* Adaptec 1430SA */
> - { PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
> -
> - /* Marvell 7042 support */
> - { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
> -
> - /* Highpoint RocketRAID PCIe series */
> - { PCI_VDEVICE(TTI, 0x2300), chip_7042 },
> - { PCI_VDEVICE(TTI, 0x2310), chip_7042 },
> -
> - { } /* terminate list */
> -};
> -
> static const struct mv_hw_ops mv5xxx_ops = {
> .phy_errata = mv5_phy_errata,
> .enable_leds = mv5_enable_leds,
> @@ -4303,6 +4272,37 @@ static int mv_pci_init_one(struct pci_dev *pdev,
> static int mv_pci_device_resume(struct pci_dev *pdev);
> #endif
>
> +static const struct pci_device_id mv_pci_tbl[] = {
> + { PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
> + { PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
> + { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
> + { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
> + /* RocketRAID 1720/174x have different identifiers */
> + { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
> + { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
> + { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
> +
> + { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
> + { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
> + { PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
> + { PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
> + { PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
> +
> + { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
> +
> + /* Adaptec 1430SA */
> + { PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
> +
> + /* Marvell 7042 support */
> + { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
> +
> + /* Highpoint RocketRAID PCIe series */
> + { PCI_VDEVICE(TTI, 0x2300), chip_7042 },
> + { PCI_VDEVICE(TTI, 0x2310), chip_7042 },
> +
> + { } /* terminate list */
> +};
> +
>
> static struct pci_driver mv_pci_driver = {
> .name = DRV_NAME,
> @@ -4315,6 +4315,7 @@ static struct pci_driver mv_pci_driver = {
> #endif
>
> };
> +MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
>
> /**
> * mv_print_info - Dump key info to kernel log for perusal.
> @@ -4487,7 +4488,6 @@ static void __exit mv_exit(void)
> MODULE_AUTHOR("Brett Russ");
> MODULE_DESCRIPTION("SCSI low-level driver for Marvell SATA controllers");
> MODULE_LICENSE("GPL v2");
> -MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
> MODULE_VERSION(DRV_VERSION);
> MODULE_ALIAS("platform:" DRV_NAME);
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks
2024-04-03 8:32 ` Damien Le Moal
@ 2024-04-03 8:50 ` Arnd Bergmann
2024-04-04 3:45 ` Damien Le Moal
0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2024-04-03 8:50 UTC (permalink / raw)
To: Damien Le Moal, Arnd Bergmann, linux-kernel, Niklas Cassel,
Saeed Bishara
Cc: Ma Ke, Uwe Kleine-König, Sergey Shtylyov, Christophe JAILLET,
Jeff Garzik, linux-ide
On Wed, Apr 3, 2024, at 10:32, Damien Le Moal wrote:
> On 4/3/24 17:06, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Building with W=1 shows a warning for an unused variable when CONFIG_PCI
>> is diabled:
>>
>> drivers/ata/sata_mv.c:790:35: error: unused variable 'mv_pci_tbl' [-Werror,-Wunused-const-variable]
>> static const struct pci_device_id mv_pci_tbl[] = {
>>
>> Move the table into the same block that containsn the pci_driver
>> definition.
>>
>> Fixes: 7bb3c5290ca0 ("sata_mv: Remove PCI dependency")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> The patch title is also not describing what the patch does.
> Are you OK with changing that to:
>
> ata: sata_mv: Fix PCI device ID table declaration warning
>
> ?
Yes, please do, thanks!
I had first tried to remove all the #ifdef checks and just
rely on dead-code-elimination doing the same when
pci_register_driver() is stubbed out and IS_ENABLED(CONFIG_OF)
checks turn off the rest. Unfortunately, the include/linux/pci.h
interfaces are not all stubbed out here and cause compile-time
failures without CONFIG_PCI, so that didn't work out.
Arnd
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks
2024-04-03 8:50 ` Arnd Bergmann
@ 2024-04-04 3:45 ` Damien Le Moal
0 siblings, 0 replies; 11+ messages in thread
From: Damien Le Moal @ 2024-04-04 3:45 UTC (permalink / raw)
To: Arnd Bergmann, Arnd Bergmann, linux-kernel, Niklas Cassel,
Saeed Bishara
Cc: Ma Ke, Uwe Kleine-König, Sergey Shtylyov, Christophe JAILLET,
Jeff Garzik, linux-ide
On 4/3/24 17:50, Arnd Bergmann wrote:
> On Wed, Apr 3, 2024, at 10:32, Damien Le Moal wrote:
>> On 4/3/24 17:06, Arnd Bergmann wrote:
>>> From: Arnd Bergmann <arnd@arndb.de>
>>>
>>> Building with W=1 shows a warning for an unused variable when CONFIG_PCI
>>> is diabled:
>>>
>>> drivers/ata/sata_mv.c:790:35: error: unused variable 'mv_pci_tbl' [-Werror,-Wunused-const-variable]
>>> static const struct pci_device_id mv_pci_tbl[] = {
>>>
>>> Move the table into the same block that containsn the pci_driver
>>> definition.
>>>
>>> Fixes: 7bb3c5290ca0 ("sata_mv: Remove PCI dependency")
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>> The patch title is also not describing what the patch does.
>> Are you OK with changing that to:
>>
>> ata: sata_mv: Fix PCI device ID table declaration warning
>>
>> ?
>
> Yes, please do, thanks!
Applied to for-6.9-fixes with discussed tweaks and removal of extra blanklines
pointed out by Andy. Thanks !
>
> I had first tried to remove all the #ifdef checks and just
> rely on dead-code-elimination doing the same when
> pci_register_driver() is stubbed out and IS_ENABLED(CONFIG_OF)
> checks turn off the rest. Unfortunately, the include/linux/pci.h
> interfaces are not all stubbed out here and cause compile-time
> failures without CONFIG_PCI, so that didn't work out.
>
> Arnd
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks
2024-04-03 8:06 ` [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks Arnd Bergmann
2024-04-03 8:29 ` Damien Le Moal
2024-04-03 8:32 ` Damien Le Moal
@ 2024-04-03 9:10 ` Andy Shevchenko
2 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2024-04-03 9:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, Damien Le Moal, Niklas Cassel, Saeed Bishara,
Arnd Bergmann, Ma Ke, Uwe Kleine-König, Sergey Shtylyov,
Christophe JAILLET, Jeff Garzik, linux-ide
On Wed, Apr 03, 2024 at 10:06:48AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Building with W=1 shows a warning for an unused variable when CONFIG_PCI
> is diabled:
>
> drivers/ata/sata_mv.c:790:35: error: unused variable 'mv_pci_tbl' [-Werror,-Wunused-const-variable]
> static const struct pci_device_id mv_pci_tbl[] = {
>
> Move the table into the same block that containsn the pci_driver
> definition.
...
> + { } /* terminate list */
> +};
> +
Too many blank lines now.
>
> static struct pci_driver mv_pci_driver = {
> .name = DRV_NAME,
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
2024-04-03 8:06 ` [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks Arnd Bergmann
@ 2024-04-06 5:20 ` patchwork-bot+netdevbpf
2024-04-10 8:02 ` (subset) " Sebastian Reichel
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-06 5:20 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, arnd, mpe, christophe.leroy, dlemoal, jikos, gregkh,
minyard, peterhuewe, jarkko, kristo, sboyd, abbotti, hsweeten,
srinivas.pandruvada, lenb, rafael, john.allen, herbert, vkoul,
ardb, andersson, mdf, liviu.dudau, benjamin.tissoires, andi.shyti,
michael.hennerich, peda, lars, jic23, dmitry.torokhov,
markuss.broks, alexandre.torgue, lee, kuba, Shyam-sundar.S-k,
iyappan, yisen.zhuang, stf_xl, kvalo, sre, tony, broonie,
alexandre.belloni, chenxiang66, martin.petersen, neil.armstrong,
heiko, krzysztof.kozlowski, hvaibhav.linux, elder, jirislaby,
ychuang3, deller, hch, robin.murphy, rostedt, mhiramat, akpm,
keescook, trond.myklebust, anna, masahiroy, nathan, tiwai,
linuxppc-dev, linux-ide, openipmi-developer, linux-integrity,
linux-omap, linux-clk, linux-pm, linux-crypto, dmaengine,
linux-efi, linux-arm-msm, linux-fpga, dri-devel, linux-input,
linux-i2c, linux-iio, linux-stm32, linux-arm-kernel, netdev,
linux-leds, linux-wireless, linux-rtc, linux-scsi, linux-spi,
linux-amlogic, linux-rockchip, linux-samsung-soc, greybus-dev,
linux-staging, linux-serial, linux-usb, linux-fbdev, iommu,
linux-trace-kernel, kasan-dev, linux-hardening, linux-nfs,
linux-kbuild, alsa-devel, linux-sound
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 3 Apr 2024 10:06:18 +0200 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> [...]
Here is the summary with links:
- [05/34] 3c515: remove unused 'mtu' variable
https://git.kernel.org/netdev/net-next/c/17b35355c2c6
- [19/34] sunrpc: suppress warnings for unused procfs functions
(no matching commit)
- [26/34] isdn: kcapi: don't build unused procfs code
https://git.kernel.org/netdev/net-next/c/91188544af06
- [28/34] net: xgbe: remove extraneous #ifdef checks
https://git.kernel.org/netdev/net-next/c/0ef416e045ad
- [33/34] drivers: remove incorrect of_match_ptr/ACPI_PTR annotations
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: (subset) [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
2024-04-03 8:06 ` [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks Arnd Bergmann
2024-04-06 5:20 ` [PATCH 00/34] address all -Wunused-const warnings patchwork-bot+netdevbpf
@ 2024-04-10 8:02 ` Sebastian Reichel
2024-04-22 8:16 ` Michael Ellerman
2025-01-27 13:24 ` Andy Shevchenko
4 siblings, 0 replies; 11+ messages in thread
From: Sebastian Reichel @ 2024-04-10 8:02 UTC (permalink / raw)
To: linux-kernel, Arnd Bergmann
Cc: Arnd Bergmann, Michael Ellerman, Christophe Leroy, Damien Le Moal,
Jiri Kosina, Greg Kroah-Hartman, Corey Minyard, Peter Huewe,
Jarkko Sakkinen, Tero Kristo, Stephen Boyd, Ian Abbott,
H Hartley Sweeten, Srinivas Pandruvada, Len Brown,
Rafael J. Wysocki, John Allen, Herbert Xu, Vinod Koul,
Ard Biesheuvel, Bjorn Andersson, Moritz Fischer, Liviu Dudau,
Benjamin Tissoires, Andi Shyti, Michael Hennerich, Peter Rosin,
Lars-Peter Clausen, Jonathan Cameron, Dmitry Torokhov,
Markuss Broks, Alexandre Torgue, Lee Jones, Jakub Kicinski,
Shyam Sundar S K, Iyappan Subramanian, Yisen Zhuang,
Stanislaw Gruszka, Kalle Valo, Sebastian Reichel, Tony Lindgren,
Mark Brown, Alexandre Belloni, Xiang Chen, Martin K. Petersen,
Neil Armstrong, Heiko Stuebner, Krzysztof Kozlowski,
Vaibhav Hiremath, Alex Elder, Jiri Slaby, Jacky Huang,
Helge Deller, Christoph Hellwig, Robin Murphy, Steven Rostedt,
Masami Hiramatsu, Andrew Morton, Kees Cook, Trond Myklebust,
Anna Schumaker, Masahiro Yamada, Nathan Chancellor, Takashi Iwai,
linuxppc-dev, linux-ide, openipmi-developer, linux-integrity,
linux-omap, linux-clk, linux-pm, linux-crypto, dmaengine,
linux-efi, linux-arm-msm, linux-fpga, dri-devel, linux-input,
linux-i2c, linux-iio, linux-stm32, linux-arm-kernel, netdev,
linux-leds, linux-wireless, linux-rtc, linux-scsi, linux-spi,
linux-amlogic, linux-rockchip, linux-samsung-soc, greybus-dev,
linux-staging, linux-serial, linux-usb, linux-fbdev, iommu,
linux-trace-kernel, kasan-dev, linux-hardening, linux-nfs,
linux-kbuild, alsa-devel, linux-sound
On Wed, 03 Apr 2024 10:06:18 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> [...]
Applied, thanks!
[09/34] power: rt9455: hide unused rt9455_boost_voltage_values
commit: 452d8950db3e839aba1bb13bc5378f4bac11fa04
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: (subset) [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
` (2 preceding siblings ...)
2024-04-10 8:02 ` (subset) " Sebastian Reichel
@ 2024-04-22 8:16 ` Michael Ellerman
2025-01-27 13:24 ` Andy Shevchenko
4 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2024-04-22 8:16 UTC (permalink / raw)
To: linux-kernel, Arnd Bergmann
Cc: Arnd Bergmann, Michael Ellerman, Christophe Leroy, Damien Le Moal,
Jiri Kosina, Greg Kroah-Hartman, Corey Minyard, Peter Huewe,
Jarkko Sakkinen, Tero Kristo, Stephen Boyd, Ian Abbott,
H Hartley Sweeten, Srinivas Pandruvada, Len Brown,
Rafael J. Wysocki, John Allen, Herbert Xu, Vinod Koul,
Ard Biesheuvel, Bjorn Andersson, Moritz Fischer, Liviu Dudau,
Benjamin Tissoires, Andi Shyti, Michael Hennerich
On Wed, 03 Apr 2024 10:06:18 +0200, Arnd Bergmann wrote:
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> In W=1 builds, we get warnings only static const variables in C
> files, but not in headers, which is a good compromise, but this still
> produces warning output in at least 30 files. These warnings are
> almost all harmless, but also trivial to fix, and there is no
> good reason to warn only about the non-const variables being unused.
>
> [...]
Applied to powerpc/next.
[01/34] powerpc/fsl-soc: hide unused const variable
https://git.kernel.org/powerpc/c/01acaf3aa75e1641442cc23d8fe0a7bb4226efb1
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
` (3 preceding siblings ...)
2024-04-22 8:16 ` Michael Ellerman
@ 2025-01-27 13:24 ` Andy Shevchenko
4 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2025-01-27 13:24 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, Arnd Bergmann, Michael Ellerman, Christophe Leroy,
Damien Le Moal, Jiri Kosina, Greg Kroah-Hartman, Corey Minyard,
Peter Huewe, Jarkko Sakkinen, Tero Kristo, Stephen Boyd,
Ian Abbott, H Hartley Sweeten, Srinivas Pandruvada, Len Brown,
Rafael J. Wysocki, John Allen, Herbert Xu, Vinod Koul,
Ard Biesheuvel, Bjorn Andersson, Moritz Fischer, Liviu Dudau,
Benjamin Tissoires, Andi Shyti, Michael Hennerich, Peter Rosin,
Lars-Peter Clausen, Jonathan Cameron, Dmitry Torokhov,
Markuss Broks, Alexandre Torgue, Lee Jones, Jakub Kicinski,
Shyam Sundar S K, Iyappan Subramanian, Yisen Zhuang,
Stanislaw Gruszka, Kalle Valo, Sebastian Reichel, Tony Lindgren,
Mark Brown, Alexandre Belloni, Xiang Chen, Martin K. Petersen,
Neil Armstrong, Heiko Stuebner, Krzysztof Kozlowski,
Vaibhav Hiremath, Alex Elder, Jiri Slaby, Jacky Huang,
Helge Deller, Christoph Hellwig, Robin Murphy, Steven Rostedt,
Masami Hiramatsu, Andrew Morton, Kees Cook, Trond Myklebust,
Anna Schumaker, Masahiro Yamada, Nathan Chancellor, Takashi Iwai,
linuxppc-dev, linux-ide, openipmi-developer, linux-integrity,
linux-omap, linux-clk, linux-pm, linux-crypto, dmaengine,
linux-efi, linux-arm-msm, linux-fpga, dri-devel, linux-input,
linux-i2c, linux-iio, linux-stm32, linux-arm-kernel, netdev,
linux-leds, linux-wireless, linux-rtc, linux-scsi, linux-spi,
linux-amlogic, linux-rockchip, linux-samsung-soc, greybus-dev,
linux-staging, linux-serial, linux-usb, linux-fbdev, iommu,
linux-trace-kernel, kasan-dev, linux-hardening, linux-nfs,
linux-kbuild, alsa-devel, linux-sound
On Wed, Apr 03, 2024 at 10:06:18AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> In W=1 builds, we get warnings only static const variables in C
> files, but not in headers, which is a good compromise, but this still
> produces warning output in at least 30 files. These warnings are
> almost all harmless, but also trivial to fix, and there is no
> good reason to warn only about the non-const variables being unused.
>
> I've gone through all the files that I found using randconfig and
> allmodconfig builds and created patches to avoid these warnings,
> with the goal of retaining a clean build once the option is enabled
> by default.
>
> Unfortunately, there is one fairly large patch ("drivers: remove
> incorrect of_match_ptr/ACPI_PTR annotations") that touches
> 34 individual drivers that all need the same one-line change.
> If necessary, I can split it up by driver or by subsystem,
> but at least for reviewing I would keep it as one piece for
> the moment.
>
> Please merge the individual patches through subsystem trees.
> I expect that some of these will have to go through multiple
> revisions before they are picked up, so anything that gets
> applied early saves me from resending.
Arnd, can you refresh this one? It seems some misses still...
I have got 3+ 0-day reports against one of the mux drivers.
https://lore.kernel.org/all/?q=adg792a.c
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 11+ messages in thread