Skip to content

Commit 50133cf

Browse files
geertumartinkpetersen
authored andcommitted
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. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/b2c56fa3556505befe9b4cb9a830d9e2a962e72c.1730831769.git.geert@linux-m68k.org Acked-by: Finn Thain <fthain@linux-m68k.org> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 4045de8 commit 50133cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/scsi/sun3_scsi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,13 @@ static void __exit sun3_scsi_remove(struct platform_device *pdev)
656656
iounmap(ioaddr);
657657
}
658658

659-
static struct platform_driver sun3_scsi_driver = {
659+
/*
660+
* sun3_scsi_remove() lives in .exit.text. For drivers registered via
661+
* module_platform_driver_probe() this is ok because they cannot get unbound at
662+
* runtime. So mark the driver struct with __refdata to prevent modpost
663+
* triggering a section mismatch warning.
664+
*/
665+
static struct platform_driver sun3_scsi_driver __refdata = {
660666
.remove = __exit_p(sun3_scsi_remove),
661667
.driver = {
662668
.name = DRV_MODULE_NAME,

0 commit comments

Comments
 (0)