Skip to content

Commit

Permalink
Merge patch series "scsi: Prevent several section mismatch warnings"
Browse files Browse the repository at this point in the history
Uwe Kleine-König <[email protected]> says:

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

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
martinkpetersen committed Apr 6, 2024
2 parents 0e0a4da + 4a0166d commit 83ef2ab
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
8 changes: 7 additions & 1 deletion drivers/scsi/a3000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion drivers/scsi/a4000t.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion drivers/scsi/atari_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion drivers/scsi/mac_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 83ef2ab

Please sign in to comment.