scsi: Prevent several section mismatch warnings
Subsystems (2)
cover scsi: Prevent several section mismatch warnings
Hello,
this series fixes the same issue in four drivers. The warning is a false positive and to suppress it the driver structs are marked with __refdata and a comment is added to describe the (non-trivial) situation.
Best regards
Uwe
Uwe Kleine-König (4):
scsi: a3000: Mark driver struct with __refdata to prevent section mismatch
scsi: a4000t: Mark driver struct with __refdata to prevent section mismatch
scsi: atari_scsi: Mark driver struct with __refdata to prevent section mismatch
scsi: mac_scsi: Mark driver struct with __refdata to prevent section mismatch
drivers/scsi/a3000.c | 8 +++++++- drivers/scsi/a4000t.c | 8 +++++++- drivers/scsi/atari_scsi.c | 8 +++++++- drivers/scsi/mac_scsi.c | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-)
base-commit: a6bd6c9333397f5a0e2667d4d82fef8c970108f2
Signature · 1 line
2.43.0
PATCH 1/4 scsi: a3000: 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 warning
WARNING: modpost: drivers/scsi/a3000: section mismatch in reference: amiga_a3000_scsi_driver+0x8 (section: .data) -> amiga_a3000_scsi_remove (section: .exit.text)
that triggers on an allmodconfig W=1 build.
--- drivers/scsi/a3000.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/scsi/a3000.c +7 -1
@@ -295,7 +295,13 @@ static void __exit amiga_a3000_scsi_remove(struct platform_device *pdev)release_mem_region (res->start,resource_size (res)); } -static struct platform_driver amiga_a3000_scsi_driver = { +/* +* amiga_a3000_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 amiga_a3000_scsi_driver__refdata = { .remove_new =__exit_p (amiga_a3000_scsi_remove), .driver = { .name ="amiga-a3000-scsi" ,
Signature · 1 line
2.43.0
PATCH 2/4 scsi: a4000t: Mark driver struct with __refdata to prevent section mismatch
In reply to Uwe Kleine-KönigAs 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 warning
WARNING: modpost: drivers/scsi/a4000t: section mismatch in reference: amiga_a4000t_scsi_driver+0x8 (section: .data) -> amiga_a4000t_scsi_remove (section: .exit.text)
that triggers on an allmodconfig W=1 build.
--- drivers/scsi/a4000t.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/scsi/a4000t.c +7 -1
@@ -108,7 +108,13 @@ static void __exit amiga_a4000t_scsi_remove(struct platform_device *pdev)release_mem_region (res->start,resource_size (res)); } -static struct platform_driver amiga_a4000t_scsi_driver = { +/* +* amiga_a4000t_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 amiga_a4000t_scsi_driver__refdata = { .remove_new =__exit_p (amiga_a4000t_scsi_remove), .driver = { .name ="amiga-a4000t-scsi" ,
Signature · 1 line
2.43.0
PATCH 3/4 scsi: atari_scsi: Mark driver struct with __refdata to prevent section mismatch
In reply to Uwe Kleine-KönigAs 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 warning
WARNING: modpost: drivers/scsi/atari_scsi: section mismatch in reference: atari_scsi_driver+0x8 (section: .data) -> atari_scsi_remove (section: .exit.text)
that triggers on an allmodconfig W=1 build.
--- drivers/scsi/atari_scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/scsi/atari_scsi.c +7 -1
@@ -878,7 +878,13 @@ static void __exit atari_scsi_remove(struct platform_device *pdev)atari_stram_free (atari_dma_buffer); } -static struct platform_driver atari_scsi_driver = { +/* +* atari_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 atari_scsi_driver__refdata = { .remove_new =__exit_p (atari_scsi_remove), .driver = { .name =DRV_MODULE_NAME ,
Signature · 1 line
2.43.0
PATCH 4/4 scsi: mac_scsi: Mark driver struct with __refdata to prevent section mismatch
In reply to Uwe Kleine-KönigAs 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 warning
WARNING: modpost: drivers/scsi/mac_scsi: section mismatch in reference: mac_scsi_driver+0x8 (section: .data) -> mac_scsi_remove (section: .exit.text)
that triggers on an allmodconfig W=1 build.
--- drivers/scsi/mac_scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/scsi/mac_scsi.c +7 -1
@@ -534,7 +534,13 @@ static void __exit mac_scsi_remove(struct platform_device *pdev)scsi_host_put (instance); } -static struct platform_driver mac_scsi_driver = { +/* +* mac_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 mac_scsi_driver__refdata = { .remove_new =__exit_p (mac_scsi_remove), .driver = { .name =DRV_MODULE_NAME ,
Signature · 1 line
2.43.0
Martin K. Petersen
AppliedUwe,
Quoted 4 lines
this series fixes the same issue in four drivers. The warning is a false positive and to suppress it the driver structs are marked with
__refdataand a comment is added to describe the (non-trivial) situation.
Applied to 6.10/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 9 lines · Uwe Kleine-König
this series fixes the same issue in four drivers. The warning is a false positive and to suppress it the driver structs are marked with
__refdataand a comment is added to describe the (non-trivial) situation.Best regards
Uwe[...]
Applied to 6.10/scsi-queue, thanks!
[1/4] scsi: a3000: Mark driver struct with __refdata to prevent section mismatch
https://git.kernel.org/mkp/scsi/c/e81bb6f59b35 [2/4] scsi: a4000t: Mark driver struct with __refdata to prevent section mismatch https://git.kernel.org/mkp/scsi/c/e70d4cce8923 [3/4] scsi: atari_scsi: Mark driver struct with __refdata to prevent section mismatch https://git.kernel.org/mkp/scsi/c/bb8520996fe1 [4/4] scsi: mac_scsi: Mark driver struct with __refdata to prevent section mismatch https://git.kernel.org/mkp/scsi/c/4a0166d55edd
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering