From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 4D4EC40F8D8 for ; Thu, 30 Apr 2026 13:13:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777554801; cv=none; b=oFrR6zlT1PQ57T/s5ZEX1gMVBwBvpq6bjkYLsWtp95aZ5lzGO/ldHw6o8xsDZSYPFi8SGFzrk7qMAt86iKaqjA34Z4Ghj/NghdR21OSCNH4AiKOCpAznxJZJRK7xRwL9oCILXE2SY1pS4xVlvVSO6RcTJ2+TqgLy3nsqPucUueU= 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=Ifkovqhd; arc=none smtp.client-ip=209.85.128.52 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="Ifkovqhd" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4852a9c6309so7505795e9.0 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=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=FAU+laBnEtUtqsKtQVHrzB08mfX6f6gr6ykNiU5Tq5Q=; b=Ifkovqhdhxd0TK+6XhjiysBDjtaC+MOmWI/qPtn3lQHjhLrVGltLGCMLN108K7RX/r ihjcPk4okWh/ZWUigR3WpYL3PlzawSMZE+bbmClpvvAcBzfhi/01nN8i+qOdaImlroZk /X0czTSk+soHoDFLOJr1LqXyn/05/DMHGRJiWckU6IvBlCN0wgCu/y/xVsDU5VKLsU60 XgdvrUJDy8ViF76grxuR8Dz72HusB8XqBNzGx8SPGWkYaKRaLZVuvRbbouIw3IYvniI7 QH5Zh98p/JMfZzNBZI+WWrdbt8AfX6605z5zhfjSWFQZsw/dkpnTEbXZ0xPwhxsaH1Xn q8Tg== 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=CGa8BEZyxk7FH6od9pP5F9kDk8UUByLnX6fFvGzoWp1Q8WTo8A1Bzv2D0qNMwoMG5L 7bRd/DCckE8TVWLB1QaVajcHsM80lAvUwF7FAv729Xedw7h/kzv6jIe7IJ+vXAJ5/Jkw yBjVQgQECRa22IQrmeI26x5AsKYAfXmKpa0DJyqeyjaBzdEl1PqPsuJNrdmb5UYR0ajx HaFVIMf236PaABCau/vSAGuIbS2MVYgftElgVSJM26FBJDGkcDrFJvUnCLXvjV4dNCg5 fbxbmRjE/xh8R0wetfgjyZQmOdmQb+V4DOtSc5Bc/m0cFdLogJdhcy5wtovL4eRmlcAb xRSg== X-Forwarded-Encrypted: i=1; AFNElJ9YBcJppnSkuwhf3WGG7qpJTXN2dd7rK+4+T2jHYrSrzmbNfno++rueu1wP/tzpmnlkf6mC4GeNjVc=@lists.linux.dev X-Gm-Message-State: AOJu0YwDobCy7Ed/l2kLSxRr8ZI+sAqQciVrC8tCFVvUUiju80X/Xu6v 0rS45geL8h4pumMDSabYwlYXZinmVSSELdVZ//aOUlbdZwdgzL0LsbzvEDMYYxHSEl4= X-Gm-Gg: AeBDieumC10yKFRspkUHasnCS2z24PiZumJqJAmT6hcS37ac+QnkZ/Awrwb4mKpCbva aprouqgweVk8o+6FZrt71phxGw5GCFoaXzf07YojCTx/jVRhXfO2JahfTsTXLx6uyLOTEtblHUt /PIs/lzvBPaEfFQtNhvVxy+Nj4a53XyySRZs8+YkqvVVPALFs5jG5Ffd/hO8h3u/rNSCYL99zJ1 FIP8uumXQ2x0S49y9EcsKg1NSfMhhQ2I4kqxwlekAoFy8oJeq+r2Ihi9El/OJSTa4royyHRFtIv EbpaCIt2EurMGA4fBCWKumMPoRbwu5Wf2UncMPHM9iEsJ2ZDftJsCh/CeDoZgk2cP5bo4+bx66e e0O8KFEliWCbYd6mYTz0zcvMKta3d0Xs0RnUiJiZXOuuDj0XE7Ac5jQ+T5MIZl4WEK/8pH75eUH HTPRVNOBiJPeItlK4uoUKhNvXFdikWrmaO8n15hOpPsCzkyGkDpkIIboBoVdlD4+Tn73+4vxokg 8CXQB3H83DDz+aJM05hGLwbpg== X-Received: by 2002:a05:600c:1382:b0: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: 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="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-- 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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 5FB67CD13DF for ; Thu, 30 Apr 2026 16:53:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 39B4642BBE; Thu, 30 Apr 2026 16:53:32 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TkzdU_KV1wn7; Thu, 30 Apr 2026 16:53:31 +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 smtp4.osuosl.org 2DD8D42BD3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1777568011; bh=FAU+laBnEtUtqsKtQVHrzB08mfX6f6gr6ykNiU5Tq5Q=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=J0a3JFLWnTUIFDiXCJ4ItsBMX8UISLotIZOoxQ0Oz/PPyOgkyedhOD2oFYZDqWAZw tnvS6d04AzhOBeTd4K78vDEi9QAPD/tMn0wInVMmwLD1ULK8JskxaPifTf/bYDQPrG 0szzCMCt+r5FTBPqE8RXhHzguuFTVdn4NmqPomxbEFWwYYS9NTqUhufHVwKacdZFQ8 GFbpLF26/hT16QvxZcOm7WjzqqT2b/yNGl3VYkFG4Ya53cwgCGFzzQAC59qNfh+OO4 WpFRknWtoWuxBjxRsrSlONk2AlB2QGjYD3qTuNFxUb7h1+1kiJlEW1G0Lfb/13wy+2 dhHjBsWrBYWqA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 2DD8D42BD3; Thu, 30 Apr 2026 16:53:31 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id DEB72192 for ; Thu, 30 Apr 2026 13:13:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C3EA160F4B for ; Thu, 30 Apr 2026 13:13:21 +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 C1dc8Lotay6k for ; Thu, 30 Apr 2026 13:13:19 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::336; helo=mail-wm1-x336.google.com; envelope-from=ukleinek@baylibre.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 48A3660F47 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 48A3660F47 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by smtp3.osuosl.org (Postfix) with ESMTPS id 48A3660F47 for ; Thu, 30 Apr 2026 13:13:17 +0000 (UTC) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4891c00e7aeso8197325e9.2 for ; Thu, 30 Apr 2026 06:13:17 -0700 (PDT) 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=TYzE2jtroITgm0gcbHspIMGOe6IV5aCBBQSwi+49NNeFmth5ncDFgCI/NLiMBQhVkE uQCjB3TPhw+V+/KVRdYEF1ayDy0AhOPFIG4YfAvkRChEm5DRcTbcjf381faDReebmVzy +YOZFpN7ZJjihSxUUURlyIN3GwoMGpvHa9tQP3sIz3nozPj3e+8YG9gFYmA/Ow2SHPc/ HSdu1Ry0L6/eSXACXKXvOC6JJJDsnvO9bwYwquLN4Rne/vqb2P9f6TOPgsnsAQuL8yht bpNuP8K0FJlAZTBEH3b6pSUqbwA3X4qNptcKlJMDDtSp825gq3UEjjfcC0p8BZON4E2q +Axg== X-Forwarded-Encrypted: i=1; AFNElJ+3goFROs64wJcy7Aex4r8SIoNxWMFvTCy/MD3P8u4LdF3IEB/iONGj6FkQlilTJxuaktIJrYa89J2XfZqWZwA=@lists.osuosl.org X-Gm-Message-State: AOJu0Yzsn/wOza/7i23ywJMrJgS656t4a6v2JT9dtvKzRRzpwjCtFB6f 9+SY+ki1lXkMt+xcDUu8GWNTohi3X9sLUrr70G7w16CdZVE278wwZndrWvAneZ+OA7k= X-Gm-Gg: AeBDievRdsFYnEwelwdiFZ3JaQ+dYxUFUZQ7TGIMRBw6CetHsdBQCdJApD2SOtlLfBu KRvdhPKSAzC+WgBDipel5gvDhAjoHmG97ryUqHrWy0duuxrcSbI6+FJajHhWwS/IA+Ds6I/Qpvy AKtqJUiCI0YGr+kMefY6Zz/aZ5991Mbhxdd6vdi6Tmd3rOQmEVpfI5PlAHAF0jr4Ac31QCLvhP9 t0xup3IQrHXEb9e33iqg2enTuODfb9n//GCI/p0FTvj70+6TbfehWuOcHlwQVIq9yOL8M+yTGR0 LsZPviuQUJkBGNfAMIIOI8idJYoS257PbtcJy3DViJNSq3iniagsE8+1VzjRPWV/L2+BH0h/xY4 G9y207i71aUT8QRRyMd5voDqABX+GFILgRAPievSZ0VL3atFIlC8WGFB0CZ+cdC4P/A8lzh+xIi 6e5p6mPTIB/O/dnShru+l7OkhLktqiVIlDz00PjAKV20X5/7YLf74W7grSn+gJr7iwm9Pq/pD7I kZ84ayAsU/x/nNJl/8NnyAZLA== X-Received: by 2002:a05:600c:1382:b0: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 Message-ID: References: <20260428171845.2288395-2-u.kleine-koenig@baylibre.com> <814632c8-070b-4b21-adbb-5a01a62d52f2@huawei.com> 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> 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=1777554796; x=1778159596; 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=FAU+laBnEtUtqsKtQVHrzB08mfX6f6gr6ykNiU5Tq5Q=; b=cevolYYt5SeJzXbiOyTDQdt6BuxzIR2wQ6rpvc9uX4QKwm2I+FOzE7EOz+B2H/dhNY vJf61V7eQ4u97IyO1pVq8akxdNnchArvBOXXZdmyfnxTV5jBTBBwvwjvDF+jcsbOI8a4 +kOnnwssR9cBThtoietMCTRvQuai9suGrTK99hkuUgF5leJFByKcniwKrsE/rL9BLUZr MHm9yZ9HapN7uNhPx7ZGYVaD0KB1qtgfFn7pP6lq5nsWIqEJ5O/xJoQkVdRT58/7FKnl 9g8DPVnhhL+nWMi2xQ/6dDfVtkS7b6xOXlQkzBBbUjG+AfGCAiTxWqt3DZXg7GrfjqnO Jeuw== 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=cevolYYt 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: Richard Cochran , 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 , Samuel Chessman , Fan Gong , Mengyuan Lou , Kevin Curtis , Ingo Molnar , 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 , Ethan Nelson-Moore , Philipp Stanner , Ido Schimmel , Potnuri Bharat Teja , Double Lo , Markus Schneider-Pargmann , Nathan Chancellor , Jiawen Wu , Cai Huoqing , Mark Einon , Bjorn Helgaas , Zilin Guan , linux-can@vger.kernel.org, Yibo Dong , Andy Shevchenko , 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 , Ion Badulescu , Andrew Lunn , Thomas Gleixner , Simon Horman , Yicong Hui , Marc Kleine-Budde , Johannes Berg , Heiner Kallweit , Saeed Mahameed , "David S. Miller" , Krzysztof Halasa Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" --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--