From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 403D93FE640 for ; Thu, 30 Apr 2026 13:13:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777554801; cv=none; b=hSbsO3QdxkWJVekZf91KaXnYL3VY71qoq2lnJGx1KcJdCUg+9LDRKqppNVZ4SwYG03QH9bQ7oHIQbI4rJrXiNIXB1JD0w+vWXd68GTu/qku3Zuj+yUWzcF1M5Io+NlCa11A7GlBccZIFfuQhhEhRN2XOWeVfRWtC61wv9enVNB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777554801; c=relaxed/simple; bh=RE498i0yz6ZiBeXODxWPnDudcSJ72IIOpFS8OHOnbxg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SDOLV/TudBRhTnVJtAvNECpPbq4lXn5YlJ61J3M37xKBsTYhEtuNgoXnE+H1dJH3BaxrlTZRKZ/Yfv/JwHHAr1fY+LFyZ11B5qla7yCW34LKaXfx4N+yLoKoIGCvvSmVFR0dXTkawU6hTv58kSzxxDSGz+CzY11k9eCw4oPJsYM= 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=FOu3yZCc; arc=none smtp.client-ip=209.85.128.54 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="FOu3yZCc" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4852b81c73aso6436045e9.3 for ; Thu, 30 Apr 2026 06:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777554796; x=1778159596; 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=FAU+laBnEtUtqsKtQVHrzB08mfX6f6gr6ykNiU5Tq5Q=; b=FOu3yZCcHrzK5P7pBQ0L6iq5/0AgbtI/jO9cZrMN9VmAKqVZu/qD2AdA7rWsomTwWf OvzU6324yeN0tAtqsOH6d7bKMoUmzBF6p4O8nNOtJ/HpDTAlrygdpA7/PLCRIchlz8hl PamU0Sm7DfPDu0n81FAQSty48whIi4LVFwM+UQmg5ibRTYewGBdkZh1MoxfC4TwQbM8x 2V2o7RPGYj9WuwD8h2bwv/jCgn5PIZnxLz47vS+tGtr2uvOg4Lxjsn9gLMbBf7uYqQDg cgMq/+e+QFx9I2yKEdZprao4KcJ01PfC60J/+VeWzSiw5sQCYq1o5HLEzK8lCFoDYCoU cY3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777554796; x=1778159596; 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=FAU+laBnEtUtqsKtQVHrzB08mfX6f6gr6ykNiU5Tq5Q=; b=JxtsAswA9gncxQgQ6Mpp0vku5JiY3mUykkadyCl8LoBPPup/8B7MCKKud6Dk42tY9m pTIRWmDQPG09NvPCcJWsJ0AbC4mGjEOH78ij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:488:a977:8d6 with SMTP id 5b1f17b1804b1-48a84458db6mr47509015e9.19.1777554795369; Thu, 30 Apr 2026 06:13:15 -0700 (PDT) Received: from localhost (p200300f65f114e0859f76ff87a50eb14.dip0.t-ipconnect.de. [2003:f6:5f11:4e08:59f7:6ff8:7a50:eb14]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-48a7b912ee3sm74461355e9.2.2026.04.30.06.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 06:13:14 -0700 (PDT) Date: Thu, 30 Apr 2026 15:13:13 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig_=28The_Capable_Hub=29?= To: Jijie Shao 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 , 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 , Andy Shevchenko , 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> <814632c8-070b-4b21-adbb-5a01a62d52f2@huawei.com> Precedence: bulk X-Mailing-List: linux-rdma@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="eswuwmcxtpmq7cnr" Content-Disposition: inline In-Reply-To: <814632c8-070b-4b21-adbb-5a01a62d52f2@huawei.com> --eswuwmcxtpmq7cnr 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 Hello, On Thu, Apr 30, 2026 at 02:53:29PM +0800, Jijie Shao wrote: > on 2026/4/29 1:18, 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 > > Signed-off-by: Uwe Kleine-K=F6nig (The Capable Hub) >=20 > ... >=20 > > diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c b/driver= s/net/ethernet/hisilicon/hibmcge/hbg_main.c > > index 068da2fd1fea..b3e01b2f8319 100644 > > --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c > > +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c > > @@ -489,7 +489,7 @@ static void hbg_shutdown(struct pci_dev *pdev) > > } > > static const struct pci_device_id hbg_pci_tbl[] =3D { > > - {PCI_VDEVICE(HUAWEI, 0x3730), 0}, > > + { PCI_VDEVICE(HUAWEI, 0x3730) }, > > { } > > }; >=20 > Reviewed-by: Jijie Shao Thanks. > > + { > > + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE), > > + .driver_data =3D 0, > > + }, { > > + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE), > > + .driver_data =3D 0, >=20 > Thanks for your work. >=20 > If .driver_data =3D 0, is it possible to delete it to be consistent with = other parts, for example: >=20 > { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE) } >=20 > > + }, { > > + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA), > > + .driver_data =3D HNAE3_DEV_SUPPORT_ROCE_DCB_BITS, However keeping the explicit .driver_data =3D 0 to have a contrast to other `pci_device_id`s having a non-zero .driver_data in the same driver is also a good reason to keep the (technically redundant) assignment. For other drivers I dropped these assignments if this is possible for all array members. Having said that I don't intend to rework the patch for this suggestion. Best regards Uwe --eswuwmcxtpmq7cnr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmnzVWYACgkQj4D7WH0S /k6Htwf7BvJ3rYQezsd5ccz+2MAtba8pHTB3I6pUsnO2mYagJg6HKmfMspgye4AX BO1wngPAitkKYC0Y1QVjeL8mZpJnkiTKh5ZpywnJ5LC1/Y46vbJl1a7z45/l4MF2 zOsQls/uPpw8h/Dif+kH4laLc33EYUiN6uoPtEBvyJuZUfEXWMc6KHtzmIZnagla mZcae0icKZUF5MyFeux8zVGWeLTcdBYGrtWUJ2x68bnP62MozIOSPUXTFkPxWruD HFTrL81mQYbLfZ88SKlMyogAeA7UjBd5/MpVdnfzLm1viy3XHq/Y9eIDkr/WypiX 51YxF/Ol5KsTDi2naPCCB1uZE9k0xQ== =gn92 -----END PGP SIGNATURE----- --eswuwmcxtpmq7cnr--