From nobody Mon May 25 01:59:23 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 432D432BF24 for ; Tue, 19 May 2026 14:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779202656; cv=none; b=hxltJi71ya6GDEl8D/Llbapb1ZHb4lE8kPyTNXg4BPtYv1iMf5cCcmPM6kB64QmDazR2SoUajS7ku1dT4aDHXLKindR7VmH585ZNuQlnXEi8lhqXr3ufHXcUIZO9zidmixg5Ep4VIfu4/lJg4OCLHVDQ0+bxM8HctnYV341MR/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779202656; c=relaxed/simple; bh=VOhlzXfyt3NtRjBedWxUVVcU4/zvcJ6BACjBWb8Qj/Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=r5gEh41re49Fj8is+Ju6LkfPmL08WmL8HBBGuziJeoCOaF8fdWMbg0sAIgwLrl0NBXpTxqf1UlSdb6E+iUZYI7swUfOytR832etOpqp7knHLsOhMRsVRtHF2jwcD+dpthlO6HAM2UaXDXrHP00BTdLn1SubG3wP6Cqm6AFLS2fU= 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 header.i=@baylibre.com header.b=mXEAS/Qg; arc=none smtp.client-ip=209.85.221.48 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 header.i=@baylibre.com header.b="mXEAS/Qg" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-459bf19e87bso2196749f8f.1 for ; Tue, 19 May 2026 07:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1779202648; x=1779807448; 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=7EBNNkzON228R0nJzW9A2JcF5uDKXntrK0Ded3+FE8Q=; b=mXEAS/QgsHzXaWgRSPY2Kcr9AuKg6/tpcrVbtxjp0HjDYXbzmgXXN4vPVhWnvOfP14 sQxDeplemWgq+7CGb7NpHE36wBK6jjccH+T0A23j1SovY0tumIl7dsKUwwMBKtwa5rmt luktc8yqXtdS1hpApRUAKpjsuKcz1vI8PWXnclVeLhDlLxuDKxiW+JQQBcrV0nYVo8uS f0nQSgL0H3Wd7+jXkGaK8bUPaS408ZETcX08dSWnhp5Tw+mdwkNNP0yW0Adgp+MQubgj VBMc2QHsveznRYL7fWnSts6cS3U68PHuxB0AB/J+IlbMMGwrui9J7nvq1aY4a28HpO/G 7H+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779202648; x=1779807448; 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=7EBNNkzON228R0nJzW9A2JcF5uDKXntrK0Ded3+FE8Q=; b=AHulvWdkHiJGZV+ViDBkT9Ld/v6kW1ah8kd9Tjo/L3GMt6AF5jNcGN49hC2b5CjLvr aThpIgMIUcx0+4P0nO6g+EQGfAmKV8pNF4h2KZgCoFS2QWjj659g/J6pKjE7BE++osUA Yb3ohRsNn62CkmjoCVF0ZcoIjFYovXCMDlmtROewnrfO/jY2hWQz3WlipJL9UKojYtt4 Uw/v0J5FghSIl88qDWChNEcRrADzHa8LmuBfXy7Kjcw674kQVxSRlypIdnxRWXRFu4oQ +9y4ngmnlCbKQPN3auRqIyz4xsC7NfyrxxNjGP1xYr3nx8f8PXmnIKZfYoJ+SKkjTAuE uS1w== X-Forwarded-Encrypted: i=1; AFNElJ+2sQj0jMMauhVPRrzUsGjvEw4OPlyXTZS5F2qvK7lt0H5WmyuVjg0q2zUQXZK5WdRfP6mB11wryqNTWiI=@vger.kernel.org X-Gm-Message-State: AOJu0YxRtWEGfcO/OvfzVlto7ugBiFlv+htbDI4095M5AqcUuk1q7wEA pljyTHqXevbz0dWXM3DnYulgL7L141v+CycGPCfp0w2rq19/EfzOQq5BmGZq+m00dPk= X-Gm-Gg: Acq92OEuBceF3Z6/kU4UtzYwA+VGF0cBIcSNQIi6MsgiXH4HR6zLyX/2GvjU7IprgYL kfF9s8ZZEa2diJdub3C+ERuuNCwCXeEEWVeoJIiJVXaXet13Q/rgJgggqn4IdQxKbf6JfXf6uWq 15ZiHsUmgbEZwp2CXdntJDJMSI5n48EvtF3Nfve0sECNSlKbXBNfImtWKTlC2vFOe2kFWZykZji S/jBHwycVHnjA8lQGukvOLOmghH8aqZyg4MphYyy6xfLK6VMyjA0OhpHTNNi7aksmtVkoQZqHLW C3t/wez71T2h2/sj4apxq8uFlDbfNYoQ0Cmmu5uiGiTpP93Aq4Ns+QwIKyT00BiCxsAAmDdLFdy 3L5e81SDInApES7eJpRcgb9b0XzRC+uvj7crhOQcE9GApPG6sPOOd24cwR6DeZ9EurngZpK+lHI MvnUp979J8d+SN0YOcUrfwC9HshYlFiYQg4e19gMLaxcwZDKl2JFxb22WDLPg5cQ6NRxTeGvTgK F/bIMlGFDPS+Hk= X-Received: by 2002:a05:6000:178b:b0:451:bee9:17c8 with SMTP id ffacd0b85a97d-45e5c57d3c0mr33606706f8f.6.1779202648017; Tue, 19 May 2026 07:57:28 -0700 (PDT) Received: from localhost (p200300f65f47db048a8dfcf61053817f.dip0.t-ipconnect.de. [2003:f6:5f47:db04:8a8d:fcf6:1053:817f]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-45da0a17ec2sm43287636f8f.24.2026.05.19.07.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 07:57:27 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Andrew Lunn , Vladimir Oltean Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Woojung Huh , UNGLinuxDriver@microchip.com, George McCollister , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 net-next] net: dsa: Use named initializers for struct i2c_device_id Date: Tue, 19 May 2026 16:57:22 +0200 Message-ID: <20260519145722.1590298-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=2892; i=u.kleine-koenig@baylibre.com; h=from:subject; bh=VOhlzXfyt3NtRjBedWxUVVcU4/zvcJ6BACjBWb8Qj/Y=; b=owGbwMvMwMXY3/A7olbonx/jabUkhiyequA/G0pOmrKecfz2ViPUt1Ou9/srDslyEe60xVKdS Wt/NMV0MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjARaUf2f3aJFfPN4rlVG2P/ J+e5x718daHFgqMqZ+eLIGvj4LgPBVV6Le6vFMWqLqlFxnwNf57/Su2nnFs+u9/nRPFwtfT7DQu axAqOhT294c8wPfFG+t/dRW41MT+us4Xu3p4h92GnowX/FOdl8tcypG2/pPcyV3hNbGPkXTAhW+ ZWo7/L7iXtO+rcY7jnci75m3t2VnX49JgkxV1TUz9s5a5aZM1+S/xc45qiaOZf1bb8DPMet068+ ETRrNz5yaqvf21Doiatq0yWF5zRMEXo2APTyI0qqwOaoxclcAjvT4rq6Qgpj9kfVFdorWO0zlde VvLejrjJm86b3L+hmdP9RV+XcfvzH11aCta+59L69QA= X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition. This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds. While touching these arrays, unify usage of whitespace in the list terminator. Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Reviewed-by: Andrew Lunn --- Hello, this patch is part of a bigger quest to use named initializers for mainly struct i2c_device_id::driver_data to be able to modify i2c_device_id. See e.g. https://lore.kernel.org/all/20260518111203.639603-2-u.kleine-koenig@baylibr= e.com/ for the details. This patch here isn't critical for this quest, as no driver makes use of .driver_data, so apart from the better readability this is only about consistency with other subsystems. Please tell me if I should split per driver. Best regards Uwe --- drivers/net/dsa/lan9303_i2c.c | 2 +- drivers/net/dsa/microchip/ksz9477_i2c.c | 4 ++-- drivers/net/dsa/xrs700x/xrs700x_i2c.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/lan9303_i2c.c b/drivers/net/dsa/lan9303_i2c.c index c62d27cdc117..3a09f3907f44 100644 --- a/drivers/net/dsa/lan9303_i2c.c +++ b/drivers/net/dsa/lan9303_i2c.c @@ -89,7 +89,7 @@ static void lan9303_i2c_shutdown(struct i2c_client *clien= t) /*------------------------------------------------------------------------= -*/ =20 static const struct i2c_device_id lan9303_i2c_id[] =3D { - { "lan9303" }, + { .name =3D "lan9303" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(i2c, lan9303_i2c_id); diff --git a/drivers/net/dsa/microchip/ksz9477_i2c.c b/drivers/net/dsa/micr= ochip/ksz9477_i2c.c index a2beb27459f1..6940608a65c3 100644 --- a/drivers/net/dsa/microchip/ksz9477_i2c.c +++ b/drivers/net/dsa/microchip/ksz9477_i2c.c @@ -80,8 +80,8 @@ static void ksz9477_i2c_shutdown(struct i2c_client *i2c) } =20 static const struct i2c_device_id ksz9477_i2c_id[] =3D { - { "ksz9477-switch" }, - {} + { .name =3D "ksz9477-switch" }, + { } }; =20 MODULE_DEVICE_TABLE(i2c, ksz9477_i2c_id); diff --git a/drivers/net/dsa/xrs700x/xrs700x_i2c.c b/drivers/net/dsa/xrs700= x/xrs700x_i2c.c index 9b731dea78c1..e6a7839c4a04 100644 --- a/drivers/net/dsa/xrs700x/xrs700x_i2c.c +++ b/drivers/net/dsa/xrs700x/xrs700x_i2c.c @@ -127,8 +127,8 @@ static void xrs700x_i2c_shutdown(struct i2c_client *i2c) } =20 static const struct i2c_device_id xrs700x_i2c_id[] =3D { - { "xrs700x-switch" }, - {} + { .name =3D "xrs700x-switch" }, + { } }; =20 MODULE_DEVICE_TABLE(i2c, xrs700x_i2c_id); base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731 --=20 2.47.3