From nobody Mon May 25 05:12:55 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 A07681DC9B5 for ; Mon, 18 May 2026 13:55:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779112547; cv=none; b=e4Q5rOKTUGl7ozUPFyyZJTJVIy1IYFpaMgCcOtl60E2rTCBvnMnpKSTYEPASnUeClOhPbf6dCOuZST0ybLiWJSBaqnt63AlD/dHsySw/zKi3fRUyimVe/LVhQutBvtnCWYXQ7U5tPxKqWxB4foa8GpKV5HwZPY0KFbuC3IAnkng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779112547; c=relaxed/simple; bh=xCDdm+hzTibPgPFU4xPsdg+XyBp5jlBC3sn9I1JVi5E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=eV9X/6K8wOom+fbGmP+hmIqdO8gMzeIa5+JmVlVAQEsW+qYAksB7latCo4DtgbLmSc5QdAk1gKPVWThF9my3/ek7+mI2G70EGI4ovLr37h3sRbI9tFc2lmYofnQPMokMFoabjeTDjp7WDceahaGaEGyRyz5QnLgWNZ5ypGdvATE= 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=mtEAnYxe; arc=none smtp.client-ip=209.85.128.51 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="mtEAnYxe" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-488a88aeec9so27907535e9.2 for ; Mon, 18 May 2026 06:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1779112544; x=1779717344; 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=/rK+EvCFkyeWnuc5tJ2vCdGBhRuta6MvhU9BB0hPPpY=; b=mtEAnYxeDHzRtUHMmdbxvQHajvTscT8ePWj9mXg/Xo1WQDKl+YU9KBASce5htgmUf3 EekvvXYVn+5Gn2W09W/w9wEyV1r/kz5mR8i7kyuuygpdAuxTshleywoOi/c2l4g0O4AU w0ZdzEXiOHNHv4wUWLl2lfXBJYdkoqQkRIjI7ftLSlTtc85SPTxWGw2/pPbJg9Hbt1eD zX5OwRT0UlVmi6T12TO8ML5UtNVb7543BpkpKAmUmCXKoo3NIDwKwc8T983r/h1uve8q kDxyZx5eSLhWud+2B+v6sHj3Pqpo8rS30dhYPct5cCH+EnSfnX77L/uu8qaKyJyDpENp JaNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779112544; x=1779717344; 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=/rK+EvCFkyeWnuc5tJ2vCdGBhRuta6MvhU9BB0hPPpY=; b=T9uPRwEOK76mnCsjetvvoV6uJ0a9oSJHR6APz3lt9BbH2E1/VJyTuqrzTfaAq3357j i8WtNGdiD0MegGzBIVNZr7WMzflNZf798/PKX9K+HfxscE/VByKPQKgMKTVHNQevPtY6 MoWSljSc3xTN/Nf73uZnbFVspyeAvuPZg1/u2CvKC2BtPspzOyd8Dc2LDle6lkvnhS63 ZWsYsI9hrd/I9VKDG9OIG3fcoREKZtit+nGROc5NYeB07no043J7ooiV9m5D9Q8yR77V Zx9jckdqaR2mByT2sCsVOdMdgs63LcIeiVqzSovmwLYy3PWNPt1l84b6ArZqPY/BefEe lOaA== X-Forwarded-Encrypted: i=1; AFNElJ9tz0t45e6pSQAwHTfs+oq2xT342HZspgBCQkeFAxeXQwtdXGPHplbDFditwVKtAD492ZvggVTptjkzPgM=@vger.kernel.org X-Gm-Message-State: AOJu0Yzw+cXT0ZHEMs1pgvFpb1waKhC0ZL4fXqATq743o34MOEqv9LeR d6x4V4MjVJ3SMNQvRj/k3XkKj3+dGZJRO03UtZS9QOuYvxRE7aEAep+aCl7pxnUzW6g= X-Gm-Gg: Acq92OGdo0kLi/GS6NO7yBOOp4LRFIHB+EJgxye3LSGy1sJljuGRk8qk6oaV4lEhpT1 mIxHBCq48FcP/f8wckaj0l4ypHlokx/JVXEEy6p41Q0Y7Wu+hpZR1ZAG/qPxtlsh/c0/+q3aS6G NFPr4lE1vYXxs8T42W85dUfQ59imJDcknscHvW6IoA+vgpG8Fz3AYgd+qLnIneQZEE1gKk+w54t S7GotRrK9xLPEAr9tIusH233I5VrD8k/sCJdwFzA+LdgpeECA8dpLEKYmlFy/vT2YJIydy097sb 780z9vD4w32/JODQ7boH+FrH1yBgvqINL+dHlTFAvlBowIeXuC75PDy2wHtnOYCnM2gheysyO1f RwVmOMkXsWxyvmcos3GAF7+wBf4JDFLrcDUGlqDgu9k6ArNDqP2JyvoT80RoruADmAmPTuNEjyd rMkycgBspVkHI/etv0IQViGl5P+nE/b6GZoniCMK1GUu9XGCMoPDvc7BkiA6NeTnlxxKSUnXKrT xa/lvS5uRloIA== X-Received: by 2002:a05:600c:8b47:b0:48f:dfe3:dae3 with SMTP id 5b1f17b1804b1-48fe63223edmr251332305e9.17.1779112544031; Mon, 18 May 2026 06:55:44 -0700 (PDT) Received: from localhost (p200300f65f47db04e77777300859e43d.dip0.t-ipconnect.de. [2003:f6:5f47:db04:e777:7730:859:e43d]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-48fe53804aesm243271115e9.15.2026.05.18.06.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 06:55:43 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman Cc: Richard Leitner , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] usb: misc: Use named initializers for struct i2c_device_id Date: Mon, 18 May 2026 15:55:36 +0200 Message-ID: <20260518135536.781168-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=3131; i=u.kleine-koenig@baylibre.com; h=from:subject; bh=xCDdm+hzTibPgPFU4xPsdg+XyBp5jlBC3sn9I1JVi5E=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqCxpYAAfqh04rwchaxegSoOb2KXEwwQWJ6W1OA D/KLdO8HfuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCagsaWAAKCRCPgPtYfRL+ TqF/B/9Rhp2CR+neUDnVJapQesz7GowVF4IhaDMaVI7um7t2Rio3dQ+q7WKcSjtEUC14TqRAFCA Mxp2Dpc7D/2sZZ/tzR7jI2LExfLtZHbblWJfomdpj5WKVndd39p9EreDN8dKLuUnTfURzpR+gpv LX+y8cRJfh7Oxt6909okOnaGpWaWSzYN1EwGaxzDVTiokNJoYu7RIy73BiGYvGsHU0vAw7AI1Vt amOfeZTb5ChogTQiOWbkKD0hQdEqfAaf8Uw777MFk5AUacSN8H4u2KcfnD37QRKJgKSMj/voNNQ DZtUaZ2ea3FuIgd20ihLw784zzbDLmlhj5ymh7DQ2URLJ1UR 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. While touching all these arrays, unify usage of whitespace in the list terminator. This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds. Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Reviewed-by: Richard Leitner --- 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. Best regards Uwe drivers/usb/misc/usb251xb.c | 18 +++++++++--------- drivers/usb/misc/usb3503.c | 2 +- drivers/usb/misc/usb4604.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 7c0778631bea..fb0693742f01 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -746,15 +746,15 @@ static int usb251xb_i2c_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(usb251xb_i2c_pm_ops, usb251xb_i2c_suspend,= usb251xb_i2c_resume); =20 static const struct i2c_device_id usb251xb_id[] =3D { - { "usb2422" }, - { "usb2512b" }, - { "usb2512bi" }, - { "usb2513b" }, - { "usb2513bi" }, - { "usb2514b" }, - { "usb2514bi" }, - { "usb2517" }, - { "usb2517i" }, + { .name =3D "usb2422" }, + { .name =3D "usb2512b" }, + { .name =3D "usb2512bi" }, + { .name =3D "usb2513b" }, + { .name =3D "usb2513bi" }, + { .name =3D "usb2514b" }, + { .name =3D "usb2514bi" }, + { .name =3D "usb2517" }, + { .name =3D "usb2517i" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(i2c, usb251xb_id); diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c index 322e59381b78..759770a13260 100644 --- a/drivers/usb/misc/usb3503.c +++ b/drivers/usb/misc/usb3503.c @@ -390,7 +390,7 @@ static SIMPLE_DEV_PM_OPS(usb3503_platform_pm_ops, usb35= 03_platform_suspend, usb3503_platform_resume); =20 static const struct i2c_device_id usb3503_id[] =3D { - { USB3503_I2C_NAME }, + { .name =3D USB3503_I2C_NAME }, { } }; MODULE_DEVICE_TABLE(i2c, usb3503_id); diff --git a/drivers/usb/misc/usb4604.c b/drivers/usb/misc/usb4604.c index c9a2fb3518ae..2ae9656715e0 100644 --- a/drivers/usb/misc/usb4604.c +++ b/drivers/usb/misc/usb4604.c @@ -135,7 +135,7 @@ static SIMPLE_DEV_PM_OPS(usb4604_i2c_pm_ops, usb4604_i2= c_suspend, usb4604_i2c_resume); =20 static const struct i2c_device_id usb4604_id[] =3D { - { "usb4604" }, + { .name =3D "usb4604" }, { } }; MODULE_DEVICE_TABLE(i2c, usb4604_id); base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731 --=20 2.47.3