* [PATCH v1 1/1] parport: serial: Convert comments to indices in cards assignment
@ 2026-01-22 9:06 Andy Shevchenko
2026-02-04 2:46 ` Andy Shevchenko
2026-02-06 14:08 ` Andy Shevchenko
0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-01-22 9:06 UTC (permalink / raw)
To: Andy Shevchenko, linux-kernel; +Cc: Sudip Mukherjee
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] parport: serial: Convert comments to indices in cards assignment
2026-01-22 9:06 [PATCH v1 1/1] parport: serial: Convert comments to indices in cards assignment Andy Shevchenko
@ 2026-02-04 2:46 ` Andy Shevchenko
2026-02-06 14:08 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-02-04 2:46 UTC (permalink / raw)
To: linux-kernel; +Cc: Sudip Mukherjee
On Thu, Jan 22, 2026 at 10:06:01AM +0100, Andy Shevchenko wrote:
> 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.
Any comments on this?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] parport: serial: Convert comments to indices in cards assignment
2026-01-22 9:06 [PATCH v1 1/1] parport: serial: Convert comments to indices in cards assignment Andy Shevchenko
2026-02-04 2:46 ` Andy Shevchenko
@ 2026-02-06 14:08 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-02-06 14:08 UTC (permalink / raw)
To: linux-kernel; +Cc: Sudip Mukherjee
On Thu, Jan 22, 2026 at 10:06:01AM +0100, Andy Shevchenko wrote:
> 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.
Sudip, any comments on this?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-06 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-22 9:06 [PATCH v1 1/1] parport: serial: Convert comments to indices in cards assignment Andy Shevchenko
2026-02-04 2:46 ` Andy Shevchenko
2026-02-06 14:08 ` Andy Shevchenko
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®