From 18ae351fec146e77a454449a47f3268db591ff7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Tue, 26 May 2026 16:17:27 +0200 Subject: [PATCH 1/6] scsi: ata: pata_budda: Use named initializer for zorro_device_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using named initializers is more explicit and thus easier to parse for a human. It's also more robust to changes in the struct definition. This robustness is relevant for a planned change to struct zorro_device_id that replaces .driver_data by an anonymous union. This change doesn't introduce changes to the compiled zorro_device_id array. Signed-off-by: Uwe Kleine-König (The Capable Hub) Acked-by: Niklas Cassel Acked-by: Damien Le Moal Reviewed-by: Geert Uytterhoeven Acked-by: Helge Deller Link: https://patch.msgid.link/a20f52aeee9dfcacfaea43ff280fa1867878cbbe.1779803053.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen --- drivers/ata/pata_buddha.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ata/pata_buddha.c b/drivers/ata/pata_buddha.c index c36ee991d5e5..3b1f0ee2f875 100644 --- a/drivers/ata/pata_buddha.c +++ b/drivers/ata/pata_buddha.c @@ -253,9 +253,9 @@ static void pata_buddha_remove(struct zorro_dev *z) } static const struct zorro_device_id pata_buddha_zorro_tbl[] = { - { ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA, BOARD_BUDDHA}, - { ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL, BOARD_CATWEASEL}, - { 0 } + { .id = ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA, .driver_data = BOARD_BUDDHA }, + { .id = ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL, .driver_data = BOARD_CATWEASEL }, + { } }; MODULE_DEVICE_TABLE(zorro, pata_buddha_zorro_tbl); @@ -282,7 +282,7 @@ static int __init pata_buddha_late_init(void) /* Manually bind to all X-Surf boards */ while ((z = zorro_find_device(ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, z))) { static struct zorro_device_id xsurf_ent = { - ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, BOARD_XSURF + .id = ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, .driver_data = BOARD_XSURF }; pata_buddha_probe(z, &xsurf_ent); From 85666bde770cbbfa59f25e2d704776e56466ff52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Wed, 10 Jun 2026 16:36:28 +0200 Subject: [PATCH 2/6] scsi: aha1542: Improve style of pnp_device_id array terminator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To match how device-id array terminators look like for other device types drop '.id = ""' from it and let the compiler care for zeroing the entry. There are no changes in the compiled drivers, only the source looks nicer. Signed-off-by: Uwe Kleine-König (The Capable Hub) Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/096aaa981c0bf1aaa8be75e675f17b1c9ca0086c.1781102092.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen --- drivers/scsi/aha1542.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index fd766282d4a4..93dab19c1cb9 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -1083,7 +1083,7 @@ static int isa_registered; #ifdef CONFIG_PNP static const struct pnp_device_id aha1542_pnp_ids[] = { { .id = "ADP1542" }, - { .id = "" } + { } }; MODULE_DEVICE_TABLE(pnp, aha1542_pnp_ids); From 81117c076f79fe982bca0c3009538a04694e1045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Wed, 10 Jun 2026 16:36:28 +0200 Subject: [PATCH 3/6] scsi: NCR5380: Improve style of pnp_device_id array terminator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To match how device-id array terminators look like for other device types drop '.id = ""' from it and let the compiler care for zeroing the entry. There are no changes in the compiled drivers, only the source looks nicer. Signed-off-by: Uwe Kleine-König (The Capable Hub) Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/096aaa981c0bf1aaa8be75e675f17b1c9ca0086c.1781102092.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen --- drivers/scsi/g_NCR5380.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 270eae7ac427..41731a7304dd 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -739,7 +739,7 @@ static struct isa_driver generic_NCR5380_isa_driver = { #ifdef CONFIG_PNP static const struct pnp_device_id generic_NCR5380_pnp_ids[] = { { .id = "DTC436e", .driver_data = BOARD_DTC3181E }, - { .id = "" } + { } }; MODULE_DEVICE_TABLE(pnp, generic_NCR5380_pnp_ids); From 108e48a9a405be611e6812f105b4d376de5640b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Tue, 26 May 2026 16:17:28 +0200 Subject: [PATCH 4/6] scsi: zorro: a2091: gvp11: Use named initializer for zorro_device_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using named initializers is more explicit and thus easier to parse for a human. It's also more robust to changes in the struct definition. This robustness is relevant for a planned change to struct zorro_device_id that replaces .driver_data by an anonymous union. While touching these arrays, drop explicit zeros from the list terminator. This change doesn't introduce changes to the compiled zorro_device_id arrays. Signed-off-by: Uwe Kleine-König (The Capable Hub) Reviewed-by: Geert Uytterhoeven Acked-by: Helge Deller Link: https://patch.msgid.link/9602004a447b474b15ca1e110d6d3c277f669e20.1779803053.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen --- drivers/scsi/a2091.c | 6 +++--- drivers/scsi/gvp11.c | 17 +++++++++-------- drivers/scsi/zorro7xx.c | 2 +- drivers/scsi/zorro_esp.c | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c index 204448bfd04b..f81e53b53e20 100644 --- a/drivers/scsi/a2091.c +++ b/drivers/scsi/a2091.c @@ -275,9 +275,9 @@ static void a2091_remove(struct zorro_dev *z) } static struct zorro_device_id a2091_zorro_tbl[] = { - { ZORRO_PROD_CBM_A590_A2091_1 }, - { ZORRO_PROD_CBM_A590_A2091_2 }, - { 0 } + { .id = ZORRO_PROD_CBM_A590_A2091_1 }, + { .id = ZORRO_PROD_CBM_A590_A2091_2 }, + { } }; MODULE_DEVICE_TABLE(zorro, a2091_zorro_tbl); diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c index 0420bfe9bd42..79bd64e12adc 100644 --- a/drivers/scsi/gvp11.c +++ b/drivers/scsi/gvp11.c @@ -442,14 +442,15 @@ static void gvp11_remove(struct zorro_dev *z) */ static struct zorro_device_id gvp11_zorro_tbl[] = { - { ZORRO_PROD_GVP_COMBO_030_R3_SCSI, ~0x00ffffff }, - { ZORRO_PROD_GVP_SERIES_II, ~0x00ffffff }, - { ZORRO_PROD_GVP_GFORCE_030_SCSI, ~0x01ffffff }, - { ZORRO_PROD_GVP_A530_SCSI, ~0x01ffffff }, - { ZORRO_PROD_GVP_COMBO_030_R4_SCSI, ~0x01ffffff }, - { ZORRO_PROD_GVP_A1291, ~0x07ffffff }, - { ZORRO_PROD_GVP_GFORCE_040_SCSI_1, ~0x07ffffff }, - { 0 } + /* .driver_data specifies the DMA mask */ + { .id = ZORRO_PROD_GVP_COMBO_030_R3_SCSI, .driver_data = ~0x00ffffff }, + { .id = ZORRO_PROD_GVP_SERIES_II, .driver_data = ~0x00ffffff }, + { .id = ZORRO_PROD_GVP_GFORCE_030_SCSI, .driver_data = ~0x01ffffff }, + { .id = ZORRO_PROD_GVP_A530_SCSI, .driver_data = ~0x01ffffff }, + { .id = ZORRO_PROD_GVP_COMBO_030_R4_SCSI, .driver_data = ~0x01ffffff }, + { .id = ZORRO_PROD_GVP_A1291, .driver_data = ~0x07ffffff }, + { .id = ZORRO_PROD_GVP_GFORCE_040_SCSI_1, .driver_data = ~0x07ffffff }, + { } }; MODULE_DEVICE_TABLE(zorro, gvp11_zorro_tbl); diff --git a/drivers/scsi/zorro7xx.c b/drivers/scsi/zorro7xx.c index 6aca9897b231..1f74586f0428 100644 --- a/drivers/scsi/zorro7xx.c +++ b/drivers/scsi/zorro7xx.c @@ -68,7 +68,7 @@ static struct zorro_device_id zorro7xx_zorro_tbl[] = { .id = ZORRO_PROD_GVP_GFORCE_040_060, .driver_data = (unsigned long)&zorro7xx_driver_data[3], }, - { 0 } + { } }; MODULE_DEVICE_TABLE(zorro, zorro7xx_zorro_tbl); diff --git a/drivers/scsi/zorro_esp.c b/drivers/scsi/zorro_esp.c index 1622285c9aec..178d46140674 100644 --- a/drivers/scsi/zorro_esp.c +++ b/drivers/scsi/zorro_esp.c @@ -706,7 +706,7 @@ static const struct zorro_device_id zorro_esp_zorro_tbl[] = { .id = ZORRO_ID(PHASE5, 0x19, 0), .driver_data = ZORRO_CYBERII, }, - { 0 } + { } }; MODULE_DEVICE_TABLE(zorro, zorro_esp_zorro_tbl); From 841970b2f6cbbfd57647b9e8799f6ed55e47e04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Tue, 26 May 2026 16:17:32 +0200 Subject: [PATCH 5/6] scsi: zorro: Simplify storing pointers in device id struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Technically it is fine (on all current Linux architectures) to store a pointer in an unsigned long variable. However this needs explicit casting which is an easy source for type mismatches. By replacing the plain unsigned long .driver_data in struct zorro_device_id by an anonymous union, most of the casting can be dropped. There is still some implicit casting involved (between a void * and a driver specific pointer type), but that's better than the approach to store a pointer in an unsigned long variable as this doesn't lose the information that the data being pointed to is const. All users of struct zorro_device_id are initialized in a way that is compatible with the new definition, so no adaptions are needed there. Signed-off-by: Uwe Kleine-König (The Capable Hub) Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Reviewed-by: Max Staudt Acked-by: Helge Deller Link: https://patch.msgid.link/49576a7501128c93ef318566ed7faefce163f1fd.1779803053.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen --- include/linux/mod_devicetable.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 3b0c9a251a2e..2673a1bd82c4 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -640,7 +640,11 @@ struct mdio_device_id { struct zorro_device_id { __u32 id; /* Device ID or ZORRO_WILDCARD */ - kernel_ulong_t driver_data; /* Data private to the driver */ + union { + /* Data private to the driver */ + kernel_ulong_t driver_data; + const void *driver_data_ptr; + }; }; #define ZORRO_WILDCARD (0xffffffff) /* not official */ From 0617678ca22cece6e3853e28f7fec6b0c6472df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Tue, 26 May 2026 16:17:33 +0200 Subject: [PATCH 6/6] scsi: zorro7xx: Make use of struct zorro_device_id::driver_data_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usage of .driver_data_ptr allows to drop several casts. A nice upside of that is that now the constness of the linked structures is kept and the compiler warns about zdd missing a const. So add this missing const, too. While touching the zorro_device_id array, drop an unneeded explicit zero in the list terminator. Signed-off-by: Uwe Kleine-König (The Capable Hub) Reviewed-by: Geert Uytterhoeven Acked-by: Helge Deller Link: https://patch.msgid.link/b7f3b4bfa5daabf8a3043177341b8dbb4e4d980e.1779803053.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen --- drivers/scsi/zorro7xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/zorro7xx.c b/drivers/scsi/zorro7xx.c index 1f74586f0428..21c769dc1ecb 100644 --- a/drivers/scsi/zorro7xx.c +++ b/drivers/scsi/zorro7xx.c @@ -50,23 +50,23 @@ static struct zorro_driver_data { static struct zorro_device_id zorro7xx_zorro_tbl[] = { { .id = ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS, - .driver_data = (unsigned long)&zorro7xx_driver_data[0], + .driver_data_ptr = &zorro7xx_driver_data[0], }, { .id = ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx, - .driver_data = (unsigned long)&zorro7xx_driver_data[1], + .driver_data_ptr = &zorro7xx_driver_data[1], }, { .id = ZORRO_PROD_CBM_A4091_1, - .driver_data = (unsigned long)&zorro7xx_driver_data[2], + .driver_data_ptr = &zorro7xx_driver_data[2], }, { .id = ZORRO_PROD_CBM_A4091_2, - .driver_data = (unsigned long)&zorro7xx_driver_data[2], + .driver_data_ptr = &zorro7xx_driver_data[2], }, { .id = ZORRO_PROD_GVP_GFORCE_040_060, - .driver_data = (unsigned long)&zorro7xx_driver_data[3], + .driver_data_ptr = &zorro7xx_driver_data[3], }, { } }; @@ -77,11 +77,11 @@ static int zorro7xx_init_one(struct zorro_dev *z, { struct Scsi_Host *host; struct NCR_700_Host_Parameters *hostdata; - struct zorro_driver_data *zdd; + const struct zorro_driver_data *zdd; unsigned long board, ioaddr; board = zorro_resource_start(z); - zdd = (struct zorro_driver_data *)ent->driver_data; + zdd = ent->driver_data_ptr; if (zdd->absolute) { ioaddr = zdd->offset;