scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
Subsystems (2)
PATCH 1/1 scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warnings
WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)
WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)that trigger on a Sun 3 allmodconfig build.
--- drivers/scsi/sun3_scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/scsi/sun3_scsi.c +7 -1
@@ -656,7 +656,13 @@ static void __exit sun3_scsi_remove(struct platform_device *pdev)iounmap (ioaddr); } -static struct platform_driver sun3_scsi_driver = { +/* +* sun3_scsi_remove() lives in .exit.text. For drivers registered via +* module_platform_driver_probe() this is ok because they cannot get unbound at +* runtime. So mark the driver struct with __refdata to prevent modpost +* triggering a section mismatch warning. +*/ +static struct platform_driver sun3_scsi_driver__refdata = { .remove_new =__exit_p (sun3_scsi_remove), .driver = { .name =DRV_MODULE_NAME ,
Signature · 1 line
2.34.1
Quoted 10 lines · Geert Uytterhoeven
As described in the added code comment, a reference to .exit.text is ok for drivers registered via
module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warningsWARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text) WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)that trigger on a Sun 3 allmodconfig build.
Signed-off-by Geert Uytterhoeven <[email protected]>
Thanks, Geert.
Quoted 24 lines
--- drivers/scsi/sun3_scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/scsi/sun3_scsi.c +7
-1@@ -656,7 +656,13 @@ static void __exit sun3_scsi_remove(struct platform_device *pdev)iounmap (ioaddr); } -static struct platform_driver sun3_scsi_driver = { +/* +* sun3_scsi_remove() lives in .exit.text. For drivers registered via +* module_platform_driver_probe() this is ok because they cannot get unbound at +* runtime. So mark the driver struct with __refdata to prevent modpost +* triggering a section mismatch warning. +*/ +static struct platform_driver sun3_scsi_driver__refdata = { .remove_new =__exit_p (sun3_scsi_remove), .driver = { .name =DRV_MODULE_NAME ,
Quoted 10 lines · Geert Uytterhoeven
As described in the added code comment, a reference to .exit.text is ok for drivers registered via
module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warningsWARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text) WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)that trigger on a Sun 3 allmodconfig build.
Signed-off-by Geert Uytterhoeven <[email protected]>
Seems I missed that one before posting 7308bf8a2c3d ("modpost: Enable section warning from *driver to .exit.text"). My excuse is that this driver isn't enabled for an ARCH=m68k allmodconfig build.
Thanks
Uwe
Hi Uwe,
Quoted 5 lines · Uwe Kleine-König
Quoted 4 lines · Geert Uytterhoeven
As described in the added code comment, a reference to .exit.text is ok for drivers registered via
module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warnings
Quoted 8 lines
Quoted 6 lines
WARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text) WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)that trigger on a Sun 3 allmodconfig build.
Signed-off-by Geert Uytterhoeven <[email protected]>Reviewed-by Uwe Kleine-König <[email protected]>
Thanks!
Quoted 3 lines
Seems I missed that one before posting
7308bf8a2c3d("modpost: Enable section warning from *driver to .exit.text"). My excuse is that this driver isn't enabled for an ARCH=m68k allmodconfig build.
Understandable, as there are basically 5 classes of m68k kernels:
- Classic with MMU,
- Coldfire with MMU,
- Sun-3,
- Classic without MMU,
- Coldire without MMU.
As the last two consist of multiple single-platform kernels, they're harder to do allmodconfig for.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Martin K. Petersen
AppliedGeert,
Quoted 3 lines
As described in the added code comment, a reference to .exit.text is ok for drivers registered via
module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warnings
Applied to 6.13/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 8 lines · Geert Uytterhoeven
As described in the added code comment, a reference to .exit.text is ok for drivers registered via
module_platform_driver_probe(). Make this explicit to prevent the following section mismatch warningsWARNING: modpost: drivers/scsi/sun3_scsi: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text) WARNING: modpost: drivers/scsi/sun3_scsi_vme: section mismatch in reference: sun3_scsi_driver+0x4 (section: .data) -> sun3_scsi_remove (section: .exit.text)[...]
Applied to 6.13/scsi-queue, thanks!
[1/1] scsi: sun3: Mark driver struct with __refdata to prevent section mismatch
https://git.kernel.org/mkp/scsi/c/50133cf05263
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering