From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 136323D091F for ; Wed, 29 Apr 2026 10:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777458399; cv=none; b=ckl4LdzGqkq6ExuPW2see14FHm6yfLYLInWGv5Po8AN/3Ewnyl/0LpNs6cD8Kk/73jLp7n7g1NvBTi4x4ACIMLEDckpzguGx5BTc4N3U6A/b66XZNyhKsuKvRtZ2EoQ8zYcZBSET1Te+lv7/qkVGA/pwUyJesrm/H52ySsJEAWM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777458399; c=relaxed/simple; bh=G1W/SI+R62/Tf87Hp2bXOJ+Uw+JF2EHw6TW2eBuH8Go=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R7nx+5wdfWtxFXIx/44YiDNfvrIzpP2JE0dPg4T4cwAAoNSd84d3QqYatj9mri7GoIbLMu8I/+a52tcXH6nfZ5y+MAFDMR6tRg7ix/62llO7tr4kXp06owNAT6lq7zpur9cf7BuK1tiU9/ywOV1pxh13BaUa0EN0ZYQm3w8AJOY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b=Js30MjQk; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.b="Js30MjQk" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4896c22fcbaso94946935e9.0 for ; Wed, 29 Apr 2026 03:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777458395; x=1778063195; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mfvKfJJPf0ASmalSXv+63KXtxyjY0rmQCt/O1qy7v1U=; b=Js30MjQkSNinhyHsnP1tkLeQTG/iIF/TT5f0UsCVWGg/eQtCeQ5ZuidcebKvZHmMCc kvRUw2qysu5LiOakI1H8A6NbbH6hgyu98qtgV0UG/fSw5ZUN/E4/lYDNk51Bq9NYyC4N 49gjKk98coWgt6BL1jiauqJhyIdwRqo4xwih7iigAoNtInXhWhX1X2kIMZg4GtQXGQJU mvxYYS31ygiufuijVxwEjPBF2fVNbDQdUlGJRAy/0wzLjsSfW4ULoGUPgb9ZAWBWDusM asQok7GJ1q+NUm1ajtPRTl7ZODlHMHtvS4f0sOdtdwdPhzJICrBfHcptdZtu2f4JqzM2 3LXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777458395; x=1778063195; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mfvKfJJPf0ASmalSXv+63KXtxyjY0rmQCt/O1qy7v1U=; b=XaJGm/YY0jHnO53ZcACojs9+Rj8WD/Ts83AMAkzxJT9iuftttEWy6g2uBNZ1oSONfe R9YTPI1lrdXVmHiYm1wClDyyhwjX7rM2DjLDZ98vup8jqoU/ohHiIED2Hz8DUNXWnJvx q21CB36X0/1VbGEvHfHE9eyYeMiH1oaWbF6dzTLIsVIYN6h1dorvwyKsubEswK+POcT1 ZXYBZvSqNfbW/zpNTaRHXiHbb6Wc5mCsEGqTPmuJL1KntkZTTyVoI8T6VNu/rhXlbwrB j5slipQ2z4lT9wcALUtwvmEJ7N5EAO8SXKGvELusnw7bUq5iKPlq1sN/W7eQEBURQJBD xTfw== X-Forwarded-Encrypted: i=1; AFNElJ9hshTzA8swr/66lokJcz9CfEKnbJmi6E7wlWmh42bfR4pLgNeTc6Tdns9uG5fmRr566rvVHg78luYta9c=@vger.kernel.org X-Gm-Message-State: AOJu0YxzJccegw9DA4G4LC8CjsT1PVqoUM8RbBl2rBxAdJanUcx8xg3x dPC8cH4XMJMwKsJRy9x40XLrsW7mjtjHhERGI/og2p4lrKWeSk7BE3s+/yCbKy4DCiA= X-Gm-Gg: AeBDiett4B1R3ocr1m7WeuGpIcg7O/NSpOxGOfwkYygsvMiO9ek6wU3ZtnJPpvLNL5O 0jQqw7lNdQ44UD1uqTeYZEbCFbZuFaAJ4cKjKGpG9Vc7jPtrgEDE5+KnQL60Q97d4cmGLjkVDzm J9cr2rmcg1v5E0yzzmHLDDv+QgbwG5MjStJ0jjQ2qDT9w7hnVmg4iOhH9pPLf2RxwFq/w80s4uy BxgqF8wN9ogfd+hmjg9OSIWXJf4bvD+RXp7F8RN2UQkeAcRv65EcdOOXTjTQCQRpXqdbhfeSKAU vsHO73qTvGsnASPuCmkbPzO1GxN6wKmz7YFaofUp6jlqGxjYAldmqJSvywiyex712RGa+k288Vu BclAZU39wsBcnY2E3rlPZ4TRbZoR/qCQr3nOdRsJtMcukL2xMZqGEIeRbgST20/DIm9j9jsdAzz MfFu/xu3TsWr8VpL2EsLBKwI42ixsJ36GMN+u2IUPsEkzjBt9TUDNJiEXFhsnuwqK/9WnrFvHZA /1gEiCxImtElePHocDZXFGDZQ== X-Received: by 2002:a05:600d:8402:b0:489:149a:f9e7 with SMTP id 5b1f17b1804b1-48a77b25340mr88922285e9.27.1777458393898; Wed, 29 Apr 2026 03:26:33 -0700 (PDT) Received: from localhost (p200300f65f114e08936c55da887fa426.dip0.t-ipconnect.de. [2003:f6:5f11:4e08:936c:55da:887f:a426]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-48a7b912ee3sm28053445e9.2.2026.04.29.03.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 03:26:33 -0700 (PDT) Date: Wed, 29 Apr 2026 12:26:32 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig_=28The_Capable_Hub=29?= To: Andy Shevchenko Cc: Michael Grzeschik , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Marc Kleine-Budde , Vincent Mailhol , Krzysztof Halasa , Johannes Berg , Markus Schneider-Pargmann , Steffen Klassert , David Dillow , Ion Badulescu , Mark Einon , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Manish Chopra , Potnuri Bharat Teja , Denis Kirjanov , Jijie Shao , Jian Shen , Cai Huoqing , Fan Gong , Tony Nguyen , Przemek Kitszel , Tariq Toukan , Saeed Mahameed , Leon Romanovsky , Mark Bloch , Ido Schimmel , Petr Machata , Yibo Dong , Simon Horman , Heiner Kallweit , nic_swsd@realtek.com, Jiri Pirko , Francois Romieu , Daniele Venzano , Samuel Chessman , Jiawen Wu , Mengyuan Lou , Kevin Curtis , Arend van Spriel , Stanislav Yakovlev , Richard Cochran , Kees Cook , Thomas Gleixner , Thomas Fourier , Ingo Molnar , Kory Maincent , Zilin Guan , Marco Crivellari , Vadim Fedorenko , Jacob Keller , Philipp Stanner , Bjorn Helgaas , Yeounsu Moon , Denis Benato , Yonglong Liu , Yicong Hui , Randy Dunlap , MD Danish Anwar , Nathan Chancellor , Sai Krishna , Ethan Nelson-Moore , Larysa Zaremba , Joe Damato , Double Lo , Colin Ian King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-can@vger.kernel.org, linux-parisc@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, oss-drivers@corigine.com, linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com Subject: Re: [PATCH net-next] net: Consistently define pci_device_ids using named initializers Message-ID: References: <20260428171845.2288395-2-u.kleine-koenig@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k4r3nmtfjdpszuus" Content-Disposition: inline In-Reply-To: --k4r3nmtfjdpszuus Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH net-next] net: Consistently define pci_device_ids using named initializers MIME-Version: 1.0 [I dropped a few addresses from Cc: that bounced for me before.] Hello Andy, On Wed, Apr 29, 2026 at 09:54:54AM +0300, Andy Shevchenko wrote: > On Tue, Apr 28, 2026 at 07:18:44PM +0200, Uwe Kleine-K=F6nig (The Capable= Hub) wrote: > > ... and PCI device helpers. > >=20 > > The various struct pci_device_id arrays were initialized mostly by one > > the PCI_DEVICE macros and then list expressions. The latter isn't easily > > readable if you're not into PCI. Using named initializers is more > > explicit and thus easier to parse. > >=20 > > Also use PCI_DEVICE* helper macros to assign .vendor, .device, > > .subvendor and .subdevice where appropriate and skip explicit > > assignments of 0 (which the compiler takes care of). > >=20 > > The secret plan is to make struct pci_device_id::driver_data an > > anonymous union (similar to > > https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylib= re.com/) > > and that requires named initializers. But it's also a nice cleanup on > > its own. > >=20 > > This change doesn't introduce changes to the compiled pci_device_id > > arrays. Tested on x86 and arm64. >=20 > ... >=20 > > - {0,} /* 0 terminated list. */ > > + { } /* 0 terminated list. */ >=20 > The comments like these are just noises. Agreed, but I'd consider it out of scope for this patch to drop these comments. That might also be subjective. > The rule of thumb is to play with a > trailing comma: > - always drop it in the terminator entry > - always keep it in the normal initialisers when semantically it's not a > terminator That was my intention. Will rework. > > static const struct pci_device_id liquidio_pci_tbl[] =3D { > > { /* 68xx */ > > - PCI_VENDOR_ID_CAVIUM, 0x91, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 > > + PCI_VDEVICE(CAVIUM, 0x91) >=20 > Use full fixed-width device id value(s). 0x0091 here and so on... Sounds fair. > > }, >=20 > Also seems that you may decrease number of LoC here putting it as >=20 > { PCI_VDEVICE(CAVIUM, 0x0091) }, /* 68xx */ >=20 > and so on... Agreed if all lines of an array can be compressed like that. > > { /* 66xx */ > > - PCI_VENDOR_ID_CAVIUM, 0x92, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 > > + PCI_VDEVICE(CAVIUM, 0x92) > > }, > > { /* 23xx pf */ > > - PCI_VENDOR_ID_CAVIUM, 0x9702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 > > + PCI_VDEVICE(CAVIUM, 0x9702) > > }, > > - { > > - 0, 0, 0, 0, 0, 0, 0 > > - } > > + { } > > }; >=20 > ... >=20 > > #define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \ > > - { 0, } \ > > + { } \ > > } >=20 > Why do we have this macro at all? Over engineering? Reworking that also seems to be out of scope for this patch to me. > Also I somehow managed to remove, but I remember you had an inner comma i= n some > cases after the .driver_data, when the full ID entry is located on a sing= le > line. I.o.w. do >=20 > { PCI_...(), .driver_data =3D ... // no trailing comma here! }, That was also my intention. Will rework. Best regards Uwe --k4r3nmtfjdpszuus Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmnx3NUACgkQj4D7WH0S /k7M1wf/QelV4pupjiZbLcg8qPVRzGgZ0AKqDUMY0oLZjH5ck6W8VSMONm3Ln4fu Tbzeul8HVUK14PBHvYKQiDU7OCUzVwfgAgM2qs9BuyfAmX3mBr2SaZI1M1DtYNUv 3FRPKSiDWXcbe5sguySJb0BKepJc6DdUYzpRBrF5m90mvuM2dZALWRiO3lFvMYlS Kls/wTkony/O5uB/oAAHI7y91nhHIw++GuY0fge4rmRUISKTZ+G1/Lz8VrcUzt+p 8iTGVh5MpStGQuFRrjho2JzPcrXxcOYiI6Z3rRBMCu5qZbVlrzaKcVvwCMd7n4gc gbcV922oXzCW/OtCAcZtPNggcidTXA== =we79 -----END PGP SIGNATURE----- --k4r3nmtfjdpszuus--