From nobody Sun Jun 14 02:37:16 2026 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 E6AC23E0247 for ; Mon, 4 May 2026 15:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777908279; cv=none; b=UPFzpvIiBV0KrBR/ybulPghCf8LAvoh9uxbQa6EwJ1CmVCUIYTM3TvQ0uCGAHxKb3j0uPF+KAGj/euk3YuBDmiG7heH9U5Wra2I2G15W2ogsHOmDx3KXIUsAKhXapfpUx4xAgWwscshSOSHTCgi1hMAklKKkulPIUzXo+JEV3Kg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777908279; c=relaxed/simple; bh=mBTCRfmyLiiqDTNNeCwkkG8BW2ePxsRS+eMQ6c/jyEU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=WPbhNyrHmnlTTrK+vPFFIg21WdiYuOTsLIsBRM2VoPqKEsTlxujm1JBQHfKJKxkloZh/drI/3rn+Y92NtHWREurd4d5PvzrzfEkTL0cgYlfjJlmDlo/26gC7E1qsnqHF9JVtvU3jY0YCA55FQKo0MdwdM3+9OrO/BZsrAZgUW4Q= 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=Iw/Stqm/; arc=none smtp.client-ip=209.85.221.41 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="Iw/Stqm/" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-44c4cc7c1cfso1351668f8f.0 for ; Mon, 04 May 2026 08:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777908274; x=1778513074; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s5L1gyrAMclmWaElGNBFaKeIDh6nrUu9GFr6ldCV0Kk=; b=Iw/Stqm/HlAsmJh1EkR4ve5UrnZsdbtDKiy/nujoPIyB3lIbYQo51V3nJxggAUbylr QZMwxu8Jyxztm0c4Utd4s7OCsBlEX5fuVa4f2tNcKqTrbofGpLMmwRUazJK4kRfQTRZX w0jc1k3rL8EaGNim976QE4/BKqz3ktHHs7fb3foxAe3NulCf209dTLMPTJ/EF4XyLQOe khQiVM8F82GHcu0jveCFO3QvmxQx3DSg9IpqaR5IcVwV93TFU3hKkbB8oebGQo+6SboS JGxleZy5F+KD4NO0yRtlX/Rh5bs4OxPgkR64NcnhECyysmKRtfcvbJzdz92FjSiddRUe hk0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777908274; x=1778513074; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=s5L1gyrAMclmWaElGNBFaKeIDh6nrUu9GFr6ldCV0Kk=; b=Oa/ruRQcP9OdVwlNK8KKl5SwrN9UJiUikAuefHqw7oanldcNZYbRzeUz8ypBDcaAaG jhfCo2g8wvIGxHB7hkMoLBK6q3fYy7mDS2IsNdDNtO4kafTZtwfNjFGBlH0PoAMuSUEl KNepb8YOdKbk5Bh085PJ9Ir9GEC11PQU5ZrYSPRl+xBJe5BHrsNiGIRx9SLhY+EUlFJT AZq0FwsYEbmd33oqPXUvFx1D4fRBtP4eK/V8z/xSi8+fl7dX989SlOxUXyLjiLY94Rqq 0BlK+xqoVL17ZYsn1lRamJLFjcQdLfmY7pLrZVBUudr7kxvV6Jz7DICXIHS42qOBKnTd fj7w== X-Forwarded-Encrypted: i=1; AFNElJ8Lk41/jszSnCs6OSqZnfSWCpIS/JqSV3pMf8GqNdwWzR/lE+H2i9f9VbPNjC5dgZhVfYfJYesz2S/xUiU=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7Py4npC5cDD+ObBpf2Z2naLvXV6Eic6bZBMuOBjdTPRjQ5U/v pBsCiHkfY3W6wXnTec/c6xg8Slr1nLjfq2x/cGYU3lz41MV8+7Fw9sEIuHGuM2yvuQI= X-Gm-Gg: AeBDietL4YwbiLKk26OHraVxD2/vsTLixyfA5PbkoE3GG7IXd4uQuVM3C+OEI2X/OFo 6bnhdV5hP+yXQOz6xqdnurfE2gorOj5BianIyH1R56HUCNOIaG8n5mgEd0Jx/9o2kX2K/UBaRID QQBYObUIWOR/pTaX8xMZ48PSUI5O5Gsiqydj88GkGRj6NgtEM+WxhkfvsNjAwWyZ8VT7rIXaw/k 1lV6SYovt9t77jxOhnLuaW2S/rrvxFS7DT8Al/yTP+SdXIksBUrP3nHJBuMi7ECxprYD/+7VLWk g1chu7D9Up5wmpYW4K9CxTwPyr/p/Pkk4dZlnHMu9HV5vBcRX7IXYmdwaPKvRpfvYWke2MldWsk F+5oDmwdST3QSbYztgaMD/6bkon7lzCLd0CODflcgmiNRj43e5WijLCmMyEyquEUFO0xkP058K+ Ox0JcOAtxH1OpDY0jZgDcayb4Ovj7xniG2Hs6Ah/gc+V3pnfsov1os8vIVCydhGrn8nHoAFwHrz kc8inj21QsRGxQ10SjbSiFkxg== X-Received: by 2002:a05:6000:4304:b0:43b:8858:1146 with SMTP id ffacd0b85a97d-44bb62073b9mr18108417f8f.41.1777908274234; Mon, 04 May 2026 08:24:34 -0700 (PDT) Received: from localhost (p200300f65f114e08197264a4bf9e813f.dip0.t-ipconnect.de. [2003:f6:5f11:4e08:1972:64a4:bf9e:813f]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-44a8ea7cf6asm27113524f8f.8.2026.05.04.08.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 08:24:33 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Tom Lendacky , John Allen , Herbert Xu , "David S. Miller" Cc: Markus Schneider-Pargmann , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: ccp - Define pci_device_ids using named initializers Date: Mon, 4 May 2026 17:24:21 +0200 Message-ID: <20260504152421.2147027-2-u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=3557; i=u.kleine-koenig@baylibre.com; h=from:subject; bh=mBTCRfmyLiiqDTNNeCwkkG8BW2ePxsRS+eMQ6c/jyEU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBp+LolDzRpK8wRwL1vSjXJsiuXKSCqvw6iQQJvz 6rwOs1vxx2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCafi6JQAKCRCPgPtYfRL+ Tn0XB/4r4//GL59ncvaNlSdy6qb7aJsWR7/qjqFpkviz5q3jjMAyVjvE8GpHrqt2Etkq++C74as xa5k+EYtn7sKf8uY5k9JtUqKJ1sz1s+qB4P/8OkjYn/oweswOR5t3DMI8wYUNChMbzTmWS6uf15 tkpQ/R9Fi305MJQtDqPMl4MR7UePJn54+0ozv8KSv1WdQZXdSZjxUd/8T8Mpg0HEYwlCkaWIseu HNN1fc+Sgh2IKCXYyMhu2RSOgEKaOYE2Fi+XCnvvHyx+DJpe4uNSyM8PQyNeoSK82i1Tyg/9hnp Qfn1/2iEYNa37ipCKbg/rKUTfwcYIZZ7aNJ0u1j4OEgQI5a/ X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable The .driver_data member of the struct pci_device_id array was initialized by list expressions. This isn't easily readable if you're not into PCI. Using the PCI_DEVICE macro and named initializers is more explicit and thus easier to parse. Also skip explicit assignment of 0 (which the compiler then takes care of) in the terminating entry. Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Tom Lendacky --- Hello, 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@baylibre.c= om/) and that requires named initializers. But IMHO it's also a nice cleanup on its own. The anonymous union will allow changes like the following: - { PCI_VDEVICE(AMD, 0x1537), .driver_data =3D (kernel_ulong_t)&dev_vdata[0= ] }, + { PCI_VDEVICE(AMD, 0x1537), .driver_data_ptr =3D &dev_vdata[0] }, (together with the respective change in the code when the value is used). This gets rid of a bunch of casts and thus slightly improves type safety. Best regards Uwe drivers/crypto/ccp/sp-pci.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/ccp/sp-pci.c b/drivers/crypto/ccp/sp-pci.c index 6ac805d99ccb..ede6ff9ad0c2 100644 --- a/drivers/crypto/ccp/sp-pci.c +++ b/drivers/crypto/ccp/sp-pci.c @@ -552,21 +552,21 @@ static const struct sp_dev_vdata dev_vdata[] =3D { =20 }; static const struct pci_device_id sp_pci_table[] =3D { - { PCI_VDEVICE(AMD, 0x1537), (kernel_ulong_t)&dev_vdata[0] }, - { PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&dev_vdata[1] }, - { PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&dev_vdata[2] }, - { PCI_VDEVICE(AMD, 0x1486), (kernel_ulong_t)&dev_vdata[3] }, - { PCI_VDEVICE(AMD, 0x15DF), (kernel_ulong_t)&dev_vdata[4] }, - { PCI_VDEVICE(AMD, 0x14CA), (kernel_ulong_t)&dev_vdata[5] }, - { PCI_VDEVICE(AMD, 0x15C7), (kernel_ulong_t)&dev_vdata[6] }, - { PCI_VDEVICE(AMD, 0x1649), (kernel_ulong_t)&dev_vdata[6] }, - { PCI_VDEVICE(AMD, 0x1134), (kernel_ulong_t)&dev_vdata[7] }, - { PCI_VDEVICE(AMD, 0x17E0), (kernel_ulong_t)&dev_vdata[7] }, - { PCI_VDEVICE(AMD, 0x156E), (kernel_ulong_t)&dev_vdata[8] }, - { PCI_VDEVICE(AMD, 0x17D8), (kernel_ulong_t)&dev_vdata[8] }, - { PCI_VDEVICE(AMD, 0x115A), (kernel_ulong_t)&dev_vdata[9] }, + { PCI_VDEVICE(AMD, 0x1537), .driver_data =3D (kernel_ulong_t)&dev_vdata[0= ] }, + { PCI_VDEVICE(AMD, 0x1456), .driver_data =3D (kernel_ulong_t)&dev_vdata[1= ] }, + { PCI_VDEVICE(AMD, 0x1468), .driver_data =3D (kernel_ulong_t)&dev_vdata[2= ] }, + { PCI_VDEVICE(AMD, 0x1486), .driver_data =3D (kernel_ulong_t)&dev_vdata[3= ] }, + { PCI_VDEVICE(AMD, 0x15DF), .driver_data =3D (kernel_ulong_t)&dev_vdata[4= ] }, + { PCI_VDEVICE(AMD, 0x14CA), .driver_data =3D (kernel_ulong_t)&dev_vdata[5= ] }, + { PCI_VDEVICE(AMD, 0x15C7), .driver_data =3D (kernel_ulong_t)&dev_vdata[6= ] }, + { PCI_VDEVICE(AMD, 0x1649), .driver_data =3D (kernel_ulong_t)&dev_vdata[6= ] }, + { PCI_VDEVICE(AMD, 0x1134), .driver_data =3D (kernel_ulong_t)&dev_vdata[7= ] }, + { PCI_VDEVICE(AMD, 0x17E0), .driver_data =3D (kernel_ulong_t)&dev_vdata[7= ] }, + { PCI_VDEVICE(AMD, 0x156E), .driver_data =3D (kernel_ulong_t)&dev_vdata[8= ] }, + { PCI_VDEVICE(AMD, 0x17D8), .driver_data =3D (kernel_ulong_t)&dev_vdata[8= ] }, + { PCI_VDEVICE(AMD, 0x115A), .driver_data =3D (kernel_ulong_t)&dev_vdata[9= ] }, /* Last entry must be zero */ - { 0, } + { } }; MODULE_DEVICE_TABLE(pci, sp_pci_table); =20 base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731 --=20 2.47.3