Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH] crypto: Drop explicit assigment of 0 in pci_device_id array
@ 2026-05-04 15:32 Uwe Kleine-König (The Capable Hub)
  2026-05-15 10:13 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-04 15:32 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller
  Cc: Markus Schneider-Pargmann, George Cherian, Srujana Challa,
	Bharat Bhushan, Kees Cook, Thomas Fourier, Amit Singh Tomar,
	linux-crypto, linux-kernel

Assigning .driver_data for drivers that don't use this struct member is
just noise that can better be dropped. The same applies for an explicit
zero in the terminating entry. Drop these.

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

this is a preparing change for making struct pci_device_id::driver_data an
anonymous union (similar to
https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylibre.com/).
This requires named initializers for .driver_data, but dropping unused
assignments is still better and a nice cleanup on its own.

Best regards
Uwe

 drivers/crypto/cavium/cpt/cptvf_main.c             | 4 ++--
 drivers/crypto/cavium/nitrox/nitrox_main.c         | 4 ++--
 drivers/crypto/marvell/octeontx/otx_cptvf_main.c   | 4 ++--
 drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c
index 2c9a2af38876..6af2650b1ebe 100644
--- a/drivers/crypto/cavium/cpt/cptvf_main.c
+++ b/drivers/crypto/cavium/cpt/cptvf_main.c
@@ -835,8 +835,8 @@ static void cptvf_shutdown(struct pci_dev *pdev)
 
 /* Supported devices */
 static const struct pci_device_id cptvf_id_table[] = {
-	{PCI_VDEVICE(CAVIUM, CPT_81XX_PCI_VF_DEVICE_ID), 0},
-	{ 0, }  /* end of table */
+	{ PCI_VDEVICE(CAVIUM, CPT_81XX_PCI_VF_DEVICE_ID) },
+	{ }  /* end of table */
 };
 
 static struct pci_driver cptvf_pci_driver = {
diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox/nitrox_main.c
index 8664d97261fe..e474c84d8d38 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_main.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_main.c
@@ -38,9 +38,9 @@ static unsigned int num_devices;
  * nitrox_pci_tbl - PCI Device ID Table
  */
 static const struct pci_device_id nitrox_pci_tbl[] = {
-	{PCI_VDEVICE(CAVIUM, CNN55XX_DEV_ID), 0},
+	{ PCI_VDEVICE(CAVIUM, CNN55XX_DEV_ID) },
 	/* required last entry */
-	{0, }
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, nitrox_pci_tbl);
 
diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
index 587609db6c69..5cc5c84069a9 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
@@ -957,8 +957,8 @@ static void otx_cptvf_remove(struct pci_dev *pdev)
 
 /* Supported devices */
 static const struct pci_device_id otx_cptvf_id_table[] = {
-	{PCI_VDEVICE(CAVIUM, OTX_CPT_PCI_VF_DEVICE_ID), 0},
-	{ 0, }  /* end of table */
+	{ PCI_VDEVICE(CAVIUM, OTX_CPT_PCI_VF_DEVICE_ID) },
+	{ }  /* end of table */
 };
 
 static struct pci_driver otx_cptvf_pci_driver = {
diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
index 858f851c9c8a..62b08116f808 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
@@ -460,9 +460,9 @@ static void otx2_cptvf_remove(struct pci_dev *pdev)
 
 /* Supported devices */
 static const struct pci_device_id otx2_cptvf_id_table[] = {
-	{PCI_VDEVICE(CAVIUM, OTX2_CPT_PCI_VF_DEVICE_ID), 0},
-	{PCI_VDEVICE(CAVIUM, CN10K_CPT_PCI_VF_DEVICE_ID), 0},
-	{ 0, }  /* end of table */
+	{ PCI_VDEVICE(CAVIUM, OTX2_CPT_PCI_VF_DEVICE_ID) },
+	{ PCI_VDEVICE(CAVIUM, CN10K_CPT_PCI_VF_DEVICE_ID) },
+	{ }  /* end of table */
 };
 
 static struct pci_driver otx2_cptvf_pci_driver = {

base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: Drop explicit assigment of 0 in pci_device_id array
  2026-05-04 15:32 [PATCH] crypto: Drop explicit assigment of 0 in pci_device_id array Uwe Kleine-König (The Capable Hub)
@ 2026-05-15 10:13 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2026-05-15 10:13 UTC (permalink / raw)
  To: Uwe Kleine-König (The Capable Hub)
  Cc: David S. Miller, Markus Schneider-Pargmann, George Cherian,
	Srujana Challa, Bharat Bhushan, Kees Cook, Thomas Fourier,
	Amit Singh Tomar, linux-crypto, linux-kernel

On Mon, May 04, 2026 at 05:32:21PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> Assigning .driver_data for drivers that don't use this struct member is
> just noise that can better be dropped. The same applies for an explicit
> zero in the terminating entry. Drop these.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
> Hello,
> 
> this is a preparing change for making struct pci_device_id::driver_data an
> anonymous union (similar to
> https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylibre.com/).
> This requires named initializers for .driver_data, but dropping unused
> assignments is still better and a nice cleanup on its own.
> 
> Best regards
> Uwe
> 
>  drivers/crypto/cavium/cpt/cptvf_main.c             | 4 ++--
>  drivers/crypto/cavium/nitrox/nitrox_main.c         | 4 ++--
>  drivers/crypto/marvell/octeontx/otx_cptvf_main.c   | 4 ++--
>  drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 6 +++---
>  4 files changed, 9 insertions(+), 9 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-15 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04 15:32 [PATCH] crypto: Drop explicit assigment of 0 in pci_device_id array Uwe Kleine-König (The Capable Hub)
2026-05-15 10:13 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox