mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH v1 1/1] parport: serial: Convert comments to indices in cards assignment
Date: Thu, 22 Jan 2026 10:06:01 +0100	[thread overview]
Message-ID: <20260122090601.2380747-1-andriy.shevchenko@linux.intel.com> (raw)

Instead of using comments, use explicit indices. This will help to
address an entry in an array by known index and leads to more robust
code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/parport/parport_serial.c | 94 ++++++++++++++++----------------
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index 24d4f3a3ec3d..eb8ab21e0acf 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -119,53 +119,53 @@ static int netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par,
 }
 
 static struct parport_pc_pci cards[] = {
-	/* titan_110l */		{ 1, { { 3, -1 }, } },
-	/* titan_210l */		{ 1, { { 3, -1 }, } },
-	/* netmos_9xx5_combo */		{ 1, { { 2, -1 }, }, netmos_parallel_init },
-	/* netmos_9855 */		{ 1, { { 0, -1 }, }, netmos_parallel_init },
-	/* netmos_9855_2p */		{ 2, { { 0, -1 }, { 2, -1 }, } },
-	/* netmos_9900 */		{1, { { 3, 4 }, }, netmos_parallel_init },
-	/* netmos_9900_2p */		{2, { { 0, 1 }, { 3, 4 }, } },
-	/* netmos_99xx_1p */		{1, { { 0, 1 }, } },
-	/* avlab_1s1p     */		{ 1, { { 1, 2}, } },
-	/* avlab_1s2p     */		{ 2, { { 1, 2}, { 3, 4 },} },
-	/* avlab_2s1p     */		{ 1, { { 2, 3}, } },
-	/* siig_1s1p_10x */		{ 1, { { 3, 4 }, } },
-	/* siig_2s1p_10x */		{ 1, { { 4, 5 }, } },
-	/* siig_2p1s_20x */		{ 2, { { 1, 2 }, { 3, 4 }, } },
-	/* siig_1s1p_20x */		{ 1, { { 1, 2 }, } },
-	/* siig_2s1p_20x */		{ 1, { { 2, 3 }, } },
-	/* timedia_4078a */		{ 1, { { 2, -1 }, } },
-	/* timedia_4079h */             { 1, { { 2, 3 }, } },
-	/* timedia_4085h */             { 2, { { 2, -1 }, { 4, -1 }, } },
-	/* timedia_4088a */             { 2, { { 2, 3 }, { 4, 5 }, } },
-	/* timedia_4089a */             { 2, { { 2, 3 }, { 4, 5 }, } },
-	/* timedia_4095a */             { 2, { { 2, 3 }, { 4, 5 }, } },
-	/* timedia_4096a */             { 2, { { 2, 3 }, { 4, 5 }, } },
-	/* timedia_4078u */             { 1, { { 2, -1 }, } },
-	/* timedia_4079a */             { 1, { { 2, 3 }, } },
-	/* timedia_4085u */             { 2, { { 2, -1 }, { 4, -1 }, } },
-	/* timedia_4079r */             { 1, { { 2, 3 }, } },
-	/* timedia_4079s */             { 1, { { 2, 3 }, } },
-	/* timedia_4079d */             { 1, { { 2, 3 }, } },
-	/* timedia_4079e */             { 1, { { 2, 3 }, } },
-	/* timedia_4079f */             { 1, { { 2, 3 }, } },
-	/* timedia_9079a */             { 1, { { 2, 3 }, } },
-	/* timedia_9079b */             { 1, { { 2, 3 }, } },
-	/* timedia_9079c */             { 1, { { 2, 3 }, } },
-	/* wch_ch353_1s1p*/             { 1, { { 1, -1}, } },
-	/* wch_ch353_2s1p*/             { 1, { { 2, -1}, } },
-	/* wch_ch382_0s1p*/		{ 1, { { 2, -1}, } },
-	/* wch_ch382_2s1p*/             { 1, { { 2, -1}, } },
-	/* brainboxes_5s1p */           { 1, { { 3, -1 }, } },
-	/* sunix_4008a */		{ 1, { { 1, 2 }, } },
-	/* sunix_5069a */		{ 1, { { 1, 2 }, } },
-	/* sunix_5079a */		{ 1, { { 1, 2 }, } },
-	/* sunix_5099a */		{ 1, { { 1, 2 }, } },
-	/* brainboxes_uc257 */	{ 1, { { 3, -1 }, } },
-	/* brainboxes_is300 */	{ 1, { { 3, -1 }, } },
-	/* brainboxes_uc414 */  { 1, { { 3, -1 }, } },
-	/* brainboxes_px263 */	{ 1, { { 3, -1 }, } },
+	[titan_110l]		= { 1, { { 3, -1 }, } },
+	[titan_210l]		= { 1, { { 3, -1 }, } },
+	[netmos_9xx5_combo]	= { 1, { { 2, -1 }, }, netmos_parallel_init },
+	[netmos_9855]		= { 1, { { 0, -1 }, }, netmos_parallel_init },
+	[netmos_9855_2p]	= { 2, { { 0, -1 }, { 2, -1 }, } },
+	[netmos_9900]		= {1, { { 3, 4 }, }, netmos_parallel_init },
+	[netmos_9900_2p]	= {2, { { 0, 1 }, { 3, 4 }, } },
+	[netmos_99xx_1p]	= {1, { { 0, 1 }, } },
+	[avlab_1s1p]		= { 1, { { 1, 2}, } },
+	[avlab_1s2p]		= { 2, { { 1, 2}, { 3, 4 },} },
+	[avlab_2s1p]		= { 1, { { 2, 3}, } },
+	[siig_1s1p_10x]		= { 1, { { 3, 4 }, } },
+	[siig_2s1p_10x]		= { 1, { { 4, 5 }, } },
+	[siig_2p1s_20x]		= { 2, { { 1, 2 }, { 3, 4 }, } },
+	[siig_1s1p_20x]		= { 1, { { 1, 2 }, } },
+	[siig_2s1p_20x]		= { 1, { { 2, 3 }, } },
+	[timedia_4078a]		= { 1, { { 2, -1 }, } },
+	[timedia_4079h]		= { 1, { { 2, 3 }, } },
+	[timedia_4085h]		= { 2, { { 2, -1 }, { 4, -1 }, } },
+	[timedia_4088a]		= { 2, { { 2, 3 }, { 4, 5 }, } },
+	[timedia_4089a]		= { 2, { { 2, 3 }, { 4, 5 }, } },
+	[timedia_4095a]		= { 2, { { 2, 3 }, { 4, 5 }, } },
+	[timedia_4096a]		= { 2, { { 2, 3 }, { 4, 5 }, } },
+	[timedia_4078u]		= { 1, { { 2, -1 }, } },
+	[timedia_4079a]		= { 1, { { 2, 3 }, } },
+	[timedia_4085u]		= { 2, { { 2, -1 }, { 4, -1 }, } },
+	[timedia_4079r]		= { 1, { { 2, 3 }, } },
+	[timedia_4079s]		= { 1, { { 2, 3 }, } },
+	[timedia_4079d]		= { 1, { { 2, 3 }, } },
+	[timedia_4079e]		= { 1, { { 2, 3 }, } },
+	[timedia_4079f]		= { 1, { { 2, 3 }, } },
+	[timedia_9079a]		= { 1, { { 2, 3 }, } },
+	[timedia_9079b]		= { 1, { { 2, 3 }, } },
+	[timedia_9079c]		= { 1, { { 2, 3 }, } },
+	[wch_ch353_1s1p]	= { 1, { { 1, -1}, } },
+	[wch_ch353_2s1p]	= { 1, { { 2, -1}, } },
+	[wch_ch382_0s1p]	= { 1, { { 2, -1}, } },
+	[wch_ch382_2s1p]	= { 1, { { 2, -1}, } },
+	[brainboxes_5s1p]	= { 1, { { 3, -1 }, } },
+	[sunix_4008a]		= { 1, { { 1, 2 }, } },
+	[sunix_5069a]		= { 1, { { 1, 2 }, } },
+	[sunix_5079a]		= { 1, { { 1, 2 }, } },
+	[sunix_5099a]		= { 1, { { 1, 2 }, } },
+	[brainboxes_uc257]	= { 1, { { 3, -1 }, } },
+	[brainboxes_is300]	= { 1, { { 3, -1 }, } },
+	[brainboxes_uc414]	= { 1, { { 3, -1 }, } },
+	[brainboxes_px263]	= { 1, { { 3, -1 }, } },
 };
 
 static struct pci_device_id parport_serial_pci_tbl[] = {
-- 
2.50.1


             reply	other threads:[~2026-01-22  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22  9:06 Andy Shevchenko [this message]
2026-02-04  2:46 ` Andy Shevchenko
2026-02-06 14:08 ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260122090601.2380747-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®