From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 11EA03B27C2 for ; Wed, 29 Apr 2026 10:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777458399; cv=none; b=m3BhpX0TdyAnWwa7LMdrzxC9bvz1FbOz1g1Oj694HFm1L6QWXV2++YqcrXvrmqNKmhKnd5NNz87An/k9DYVpAZBNgUp3Br22ZnWoslxUG3tJjC2C3zWjJXHp4tYh0j1WeT6UrzmufeWHH4Mj+5fI+q8Hg+wUH2+L9XB7ahNHbhk= 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=VilbVB0j; arc=none smtp.client-ip=209.85.128.44 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="VilbVB0j" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4838c15e3cbso113560555e9.3 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=lists.linux.dev; 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=VilbVB0jtjoWzuu0YzgTqx1MEpMBrYg8PFAxFtE7wD3V6OafMPjZA9yxStVfWny8PB QSzSyzoQLMowrmEMFldHjMY1Gm7YvqqobKMah9GGG2Q+4d0eRJv5JQQt1OVJtQ+qo5DH yvzkRVW9I0p+n8EnNEh0fyKZ9JLnMzUMXtexrU0L9T6o5jRFhe32LDVFGPaldHenthn+ 346PjubL/ox+svxmRXcQUAwtF5fhNspk6SXM61GALZO4ZqMk98nteZJe08oTgtFBF5LD 8qX4uXpUOQoeGKHJ3FyeYA3yhQRWPtMRUfr8V+3Z56XiKyGJhIainOdfSMc7NAlexCej xU7g== 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=P/02d773JqlFXcHQ3UC30aa4DymfC5ycd9X188CQo8P+/fPj0BZqK9YnRnVLphEIcu qeK1vSiHZN0JpO0YVu4PyVXqTIyabsXQJE0qvpJRt/xwl7W5UrEA4bQVL6FC0jYKWkcU DykNwFge7iVTQPsu+8iomrymSxLxsu/iyWCtvlqrxEzLhgGP287uMcI+1G50liUlUSrl 0/feHzqnduK/hox1jNmx/tyus34xMAXGOkgCCRRHyng6pPBldavQCWI3FBGx2OBurYhG O77dqypNNXiu1IMSs/GZeEPm+Rdb2AC4fgC4Gc8cHSPJ8trn5gLT3seYDnTvGXN9B/zr E2xg== X-Forwarded-Encrypted: i=1; AFNElJ99kOOydVEXz/Wau9Zi30meiKxDRyTlsIJNYnN/Mc/rfZCGzfL81ugXsfMgEo9tHuZrdl4musqZ32k=@lists.linux.dev X-Gm-Message-State: AOJu0YzF4Gkp+hlvLK3JvlWzDu/hPoTQMXj4iFKJim+Vq7qOsEs+pVh5 RwkIeeZeJdj+Htd68K9jdiuCDy1uZYYrlUMZqGdv+Rg1O1xVbU/mucKRji20mula3Ow= X-Gm-Gg: AeBDieseSDBcNkJjwL1/ZTyPVHuiCDjU85cVU917konDRNYXXm2xUTVN9xFQdhNUcHI D6fi8CPl6SyU3WvzS5ErKA+/HW3dCmoeT8+F3rG5UMArqrGfScNv28lMlysC2gVhd6zNr0JB9z0 HaIaOY/fp8YPqz5uzYdyvRq4BWjOSK0NeDyDejdZ/oYc90sfrWJY0sawNiuToW41jadmhrVBJ8A BPvQ+UGkhbOaHh+9mq0CrVl+kTphOXzCnD+s9jzXxaYCfzdmAng9DqXlEp2bwXtFeLpqaRoOiUA naqQkNhwaNL1WqnzHLMfaJ13aCPnfBcoFnyqUnX3f9qAx+15aQRBl9kG1n4wUm6SeFVt48xrBv7 Pu2aH2oDWtQX7y0Qmwm3Qu3qumm0b7gMucGLLl+N9logP/Z9919w3/ETClQs1GbquKxBwtSDAB/ GhLwWbnkEaCgJClfdHMyc3AT7t42O6+rUA7EnBvUoFS2U/GTJfTYHDVB2uGWDboY+J26aV7kc5M LEwDVMCRcmEUiE0zoer2Vx+yg== 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: brcm80211@lists.linux.dev 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-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 389AEFF8873 for ; Thu, 30 Apr 2026 16:53:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 440CD84EB8; Thu, 30 Apr 2026 16:53:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gvlCHGgLjfbk; Thu, 30 Apr 2026 16:53:28 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1831F84EB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1777568008; bh=mfvKfJJPf0ASmalSXv+63KXtxyjY0rmQCt/O1qy7v1U=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=f4W4BBt0OajkhdlBI5TkjfsO3qIcmZnShDYurtDtLmAFRK5+7PpyeW4ckZuoE8hYH I1p3pg5C/0O3i4zwzOAGRtBaJqxK/x1fjFFSUh2s6CQS91i6Qr0POKPcwjc0dVtKRq gQgl0HaB/vD941EATpsBJLhbICV6irU3AcYjXO/tIRXg6tWHu4oPW39JJrS1R2iGnK 0ilvmE5g6dAFl+sNfHNG1wzCyP4gmq/4q9I6AWW4eSigs94Tai6nxBccBboXD6aJDw CQCWhZY0wSjEXYMrbvQFW2+wvRalGXmQ6QnsA+Kx13kmz5qZnj5E5mGD3UEZIuu/fI sSx5oKshys0ig== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 1831F84EB3; Thu, 30 Apr 2026 16:53:28 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id E3160231 for ; Wed, 29 Apr 2026 10:26:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C7E9A6119E for ; Wed, 29 Apr 2026 10:26:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id YN__tOByw6k6 for ; Wed, 29 Apr 2026 10:26:39 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::32c; helo=mail-wm1-x32c.google.com; envelope-from=ukleinek@baylibre.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 459E960ECF DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 459E960ECF Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by smtp3.osuosl.org (Postfix) with ESMTPS id 459E960ECF for ; Wed, 29 Apr 2026 10:26:37 +0000 (UTC) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso129676205e9.2 for ; Wed, 29 Apr 2026 03:26:37 -0700 (PDT) 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=c2JfQeK5kTe1Y+xJTWSd41EU3n+UlxUxyxqW4oWgTAeixFnrviVT8GINKUrvWcig5E k4mLZgtCcpqfPlJLSw+j2XxWBVaReVD+CL8Dhuk6unz6KvFFAJ39f76Pg3fYy/V7c76G V07NPXWgfWgrcHNJnjY1TjYUFOPdrmOX9yABvavIpD0dTFMd2u1ksJREiHQdCslU3grD 1vjoRGbOqpTAkZKWUXtEuUPB3pCMLyIfyNxQhDgv+4ZVrLk2BGW8EWz/a8TmxwKwYCNE 59RJAo4Jc7e16SDqix8+oQtEaLb6Gfzxu1nkP8rjjLk3Qkzn8vNHABDg7vxIkFWdswQl 2Slw== X-Forwarded-Encrypted: i=1; AFNElJ+1Vw/JG6TUhdM5oSB/iA0yWxFFTQCJOn6z2+IuvumpbjyhSXKuHd5umBxB/MBOcwgmY+JNjnEHwop4hpNa7H4=@lists.osuosl.org X-Gm-Message-State: AOJu0Yy2hAdwB+ggVVH9pjozIfySBQZgiOG/15Q5KbduCfQbZLL4cn3a VST+IRMAE2+rTbrvaGg/UTwIlonjrxhHzylsFZNlm6z9LZNooeJBVzmlxzf1rp/Jpeo= X-Gm-Gg: AeBDievi+BOewP/lmnFcl88lqjGAkMLYpTfFKuppXoeRrDMko1CGOR5k+sfkRYUVylF IFPnR/rAHQ9EQeA4tgWsccYGVxcKHiBrqCjO6hIsMRn/UqI9ucmv9p57W3vBLAAl1I/z3UTOxoj 2tK3aTuFhuBVmeiborLYQMesvC9dGZsTqhh3ZPyB5QJ0yOXDMWou/ynYfHQxeZ4Dc9A5vj+cZJp WlwWH0EJ0JMPhpnRFahfr4XBhdIy7RJd1QnZBSi9mMLNKNOGna+nseCtOqaiEe0WlfD4j59+6hH tkcq5tL3dL49eJY/BJKojJrA8eCQcf2jBpkqcEWGC9CLA4XP9qgQuaeevIXxQXA4QyNF0zijr+L UO95YBJYi1lOOJHolxns/EIrlyVEwtSnRWxN2DvcMf+iYpxbB+AMLnKg5C087SZxrqcAuc+jLg5 GkvtuLbQ85tMdVY2TE+cRHAHprXInws0Br1p1P3wD5E/TkZZRpLOrOzp4OMzb9w8dbeJkERlpbj 0U3ncUmcXruEen7GOEvywghcw== 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 Message-ID: References: <20260428171845.2288395-2-u.kleine-koenig@baylibre.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k4r3nmtfjdpszuus" Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Thu, 30 Apr 2026 16:53:24 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777458395; x=1778063195; darn=lists.osuosl.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=B1HjytEFUrAHzKDx4QFG1YmOF0HexxWJsZKxUKd2RhnRITKY3P54T45kYpoGfUQTdq l8q0PMXW2o+84C1T8DHA57stMYsewz2Te+dmd2P6Ek9N2ggRrHJbXsw1g4SfggZpCoZP oOchcUJvsMQQu0gKpDglJz4+MZA1cTJofY+s2X7zxYcdooP+6spWhMBH288VeVxQqcZ9 osbIePGtbzHnxMgobiIfyEufrGBsXhzUSAN69pmKmnjfYXQWSAgEcnjql1kSjLFt4bLm 4+sWnCXhcKqebi64AZEMa82i+fipa2j2gcpp+ME9RCizfpy8aSXEMbvZY46s9lZWMT+O 0RNg== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=none (p=none dis=none) header.from=baylibre.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=B1HjytEF Subject: Re: [Intel-wired-lan] [PATCH net-next] net: Consistently define pci_device_ids using named initializers X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cai Huoqing , Marco Crivellari , Randy Dunlap , Yonglong Liu , Kees Cook , linux-wireless@vger.kernel.org, Larysa Zaremba , Joe Damato , brcm80211@lists.linux.dev, Daniele Venzano , Eric Dumazet , Tony Nguyen , MD Danish Anwar , Richard Cochran , Samuel Chessman , Fan Gong , Mengyuan Lou , Kevin Curtis , Ingo Molnar , Ion Badulescu , Michael Grzeschik , Yeounsu Moon , Manish Chopra , Colin Ian King , Przemek Kitszel , Thomas Fourier , Sai Krishna , Denis Kirjanov , intel-wired-lan@lists.osuosl.org, linux-parisc@vger.kernel.org, Jacob Keller , Jakub Kicinski , Paolo Abeni , Steffen Klassert , Stanislav Yakovlev , linux-rdma@vger.kernel.org, Arend van Spriel , nic_swsd@realtek.com, Jiri Pirko , Philipp Stanner , Ido Schimmel , Potnuri Bharat Teja , Double Lo , Markus Schneider-Pargmann , Nathan Chancellor , Jiawen Wu , Marc Kleine-Budde , Bjorn Helgaas , Zilin Guan , linux-can@vger.kernel.org, Yibo Dong , Ethan Nelson-Moore , Petr Machata , Kory Maincent , brcm80211-dev-list.pdl@broadcom.com, GR-Linux-NIC-Dev@marvell.com, Vadim Fedorenko , Leon Romanovsky , Denis Benato , Rasesh Mody , netdev@vger.kernel.org, oss-drivers@corigine.com, Vincent Mailhol , Mark Bloch , linux-kernel@vger.kernel.org, Tariq Toukan , Jian Shen , Jijie Shao , Andrew Lunn , Thomas Gleixner , Simon Horman , Yicong Hui , Mark Einon , Johannes Berg , Heiner Kallweit , Saeed Mahameed , "David S. Miller" , Krzysztof Halasa Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" --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--