[PATCH] gpio: amd8111: Drop useless zeros in array initialisation

Uwe Kleine-König (The Capable Hub) posted 1 patch 1 month, 1 week ago
drivers/gpio/gpio-amd8111.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] gpio: amd8111: Drop useless zeros in array initialisation
Posted by Uwe Kleine-König (The Capable Hub) 1 month, 1 week ago
The compiler fills in zeros as needed, so there is no technical reason
to add explicit zeros at the end of a list initializer. Drop them.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
Hello,

I'm currently cleaning up lots of pci_device_id tables to not use list
initializers. This one is a bit of an outlier because for my next patch
quest I need only named initializers for .driver_data, so I don't really
*need* this patch in. But this first array member's 0 in the original
code initializes .class. It's very unusual to assign .class but not
.class_mask, so I guess this was a mistake (without consequences).
(Named initializers are great!)

Best regards
UWe


 drivers/gpio/gpio-amd8111.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
index 15fd5e210d74..8078b5d7b80c 100644
--- a/drivers/gpio/gpio-amd8111.c
+++ b/drivers/gpio/gpio-amd8111.c
@@ -59,8 +59,8 @@
  * want to register another driver on the same PCI id.
  */
 static const struct pci_device_id pci_tbl[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS), 0 },
-	{ 0, },	/* terminate list */
+	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS) },
+	{ },	/* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, pci_tbl);
 

base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
-- 
2.47.3

Re: [PATCH] gpio: amd8111: Drop useless zeros in array initialisation
Posted by Bartosz Golaszewski 1 month, 1 week ago
On Wed, 06 May 2026 16:49:18 +0200, Uwe Kleine-König (The Capable Hub) wrote:
> The compiler fills in zeros as needed, so there is no technical reason
> to add explicit zeros at the end of a list initializer. Drop them.
> 
> 

Applied, thanks!

[1/1] gpio: amd8111: Drop useless zeros in array initialisation
      https://git.kernel.org/brgl/c/87e4643ab19cdfa152b7d10b3418cfff19724109

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>