Re: [PATCH] media: pci: Use PCI_DEVICE macros and drop zeros from pci_device_id arrays

Uwe Kleine-König (The Capable Hub) <[email protected]> Thu, 7 May 2026 17:17:30 +0200
Newsgroups gmane.linux.kernel,gmane.linux.drivers.video-input-infrastructure,gmane.comp.video.mjpeg.user
Message-ID <afysRvNhUCW75YiB@monoceros>
--g75pm3ww6reiqzz7
Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: [PATCH] media: pci: Use PCI_DEVICE macros and drop zeros from
 pci_device_id arrays
MIME-Version: 1.0

Hello,

On Wed, May 06, 2026 at 07:44:12PM +0200, Uwe Kleine-K=F6nig (The Capable H=
ub) wrote:
> Some pci_device_id arrays already used the PCI_DEVICE macros, others
> used named initializers or list initializers. Unify all to use the
> PCI_DEVICE macros and (if applicable) a named initializer for
> .driver_data. Also drop all zeros that the compiler can care for and
> unify indention and spacing.
>=20
> There are no changes introduced by this commit to the compiled arrays for
> ARCH=3Dx86 and ARCH=3Darm64 builds.
>=20
> Signed-off-by: Uwe Kleine-K=F6nig (The Capable Hub) <u.kleine-koenig@bayl=
ibre.com>
> ---
> Hello,
>=20
> 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=
=2Ecom/).
> This requires named initializers for .driver_data. Not all changes here
> are required for that, but I expanded the quest to unify a bit more than
> necessary.
>=20
> I put all changes in a single patch, if you prefer it being split I can d=
o that.

I just noticed I failed to put the following hunk into the patch:

diff --git a/include/media/drv-intf/saa7146.h b/include/media/drv-intf/saa7=
146.h
index 71ce63c99cb4..b8f2fe5680f0 100644
--- a/include/media/drv-intf/saa7146.h
+++ b/include/media/drv-intf/saa7146.h
@@ -77,13 +77,10 @@ struct saa7146_pci_extension_data {
 	void *ext_priv;			/* most likely a name string */
 };
=20
-#define MAKE_EXTENSION_PCI(x_var, x_vendor, x_device)		\
-	{							\
-		.vendor    =3D PCI_VENDOR_ID_PHILIPS,		\
-		.device	   =3D PCI_DEVICE_ID_PHILIPS_SAA7146,	\
-		.subvendor =3D x_vendor,				\
-		.subdevice =3D x_device,				\
-		.driver_data =3D (unsigned long)& x_var,		\
+#define MAKE_EXTENSION_PCI(x_var, x_vendor, x_device)						\
+	{											\
+		PCI_VDEVICE_SUB(PHILIPS, PCI_DEVICE_ID_PHILIPS_SAA7146, (x_vendor), (x_d=
evice)),\
+		.driver_data =3D (unsigned long)&(x_var),						\
 	}
=20
 struct saa7146_extension

but that's not urgent as the current definition of MAKE_EXTENSION_PCI()
is good enough to not block the next step of my quest. I'll address that
in a v2 (if it comes to that) or later together with the next step
making the driver_data line:

	.driver_data_ptr =3D &(x_var),

(or if you apply this version, feel free to squash the diff into the
commit).

Best regards
Uwe

--g75pm3ww6reiqzz7
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmn8rQcACgkQj4D7WH0S
/k4cbwf/XHootzTV2dhXqXjfIYmwScfZDuXhC38cQlxVyoIlhSgTqnzIftlcdZzB
ORcP5144p3lUqXTTPW8J8BJzmXJbC0W0ntqQjr796pGP13R8oSOScBfG4Cr93SH0
AIGPzXGluScUNpGnhZfsU0yKaE62n0J5CHPDanLIpG4o0PwnRscgK7gR1TbsIvP9
Ph3ao4z/ctecuaGBQUth0WbYzYwO7RUZSWdvqocIbgEq+RU5kPSEE9xwG4/ML+Za
EYlKuZwEQl2CnbM9pmT7eIcn9RmzVHCBL+KsO5wWKRRbRECKboQ4yEhFpRpT+CXh
2U0+ECHorGmEYceB/zv5vmVxpXYJfg==
=m8GL
-----END PGP SIGNATURE-----

--g75pm3ww6reiqzz7--