]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwrng: drivers - Drop unused assignment to pci driver_data
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Mon, 4 May 2026 09:20:14 +0000 (11:20 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 May 2026 10:08:36 +0000 (18:08 +0800)
Explicitly assigning 0 to driver_data in drivers not using this member
has no benefit. Drop these and similarly depend on the compiler to
zero-initialize the list terminator.

This is a preparation for making struct pci_device_id::driver_data an
anonymous union (which makes initializing using a list expression fail),
but it's also a nice cleanup by itself.

It was verified on x86 and arm64 that this change doesn't introduce
changes to the compiled drivers.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/amd-rng.c
drivers/char/hw_random/cavium-rng.c
drivers/char/hw_random/geode-rng.c

index 332d594bdf70990dd63ff90cfdca30de056b39f7..dff80daae587700083db5fe68820f27b857a7450 100644 (file)
@@ -47,9 +47,9 @@
  * want to register another driver on the same PCI id.
  */
 static const struct pci_device_id pci_tbl[] = {
-       { PCI_VDEVICE(AMD, 0x7443), 0, },
-       { PCI_VDEVICE(AMD, 0x746b), 0, },
-       { 0, }, /* terminate list */
+       { PCI_VDEVICE(AMD, 0x7443) },
+       { PCI_VDEVICE(AMD, 0x746b) },
+       { }     /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, pci_tbl);
 
index d9d7b6038c06581a19d70025226eeeb7f830a2a8..3e2c042009f66b1f164edce89f422f9a17006713 100644 (file)
@@ -73,8 +73,8 @@ static void cavium_rng_remove(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id cavium_rng_pf_id_table[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, 0xa018), 0, 0, 0}, /* Thunder RNM */
-       {0,},
+       { PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, 0xa018) }, /* Thunder RNM */
+       { },
 };
 
 MODULE_DEVICE_TABLE(pci, cavium_rng_pf_id_table);
index 1b21d58e1768e94981a039b5d97567c95f007ec5..ae63eff64344885920f93eb6794f665a111e6e61 100644 (file)
@@ -46,8 +46,8 @@
  * want to register another driver on the same PCI id.
  */
 static const struct pci_device_id pci_tbl[] = {
-       { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_LX_AES), 0, },
-       { 0, }, /* terminate list */
+       { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_LX_AES) },
+       { }     /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, pci_tbl);