misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
PATCH 1/1 misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
After building the kernel with Clang, the following section mismatch warning appears:
WARNING: vmlinux.o(.text+0x3bf19a6): Section mismatch in reference from the function ssc_probe() to the function .init.text:atmel_ssc_get_driver_data()
The function ssc_probe() references
the function __init atmel_ssc_get_driver_data().
This is often because ssc_probe lacks a __init
annotation or the annotation of atmel_ssc_get_driver_data is wrong.
Remove __init from atmel_ssc_get_driver_data to get rid of the mismatch.
---
Alternatively, ssc_probe could be marked as __init, I don't think there is any way for the probe to defer. I decided to go with the more conservative option first but I'm happy to respin if necessary.
Thanks!
drivers/misc/atmel-ssc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/atmel-ssc.c +1 -1
@@ -132,7 +132,7 @@ static const struct of_device_id atmel_ssc_dt_ids[] = {MODULE_DEVICE_TABLE (of, atmel_ssc_dt_ids);#endif -static inline const struct atmel_ssc_platform_data *__init +static inline const struct atmel_ssc_platform_data *atmel_ssc_get_driver_data (struct platform_device *pdev) {if (pdev->dev.of_node) {
Signature · 1 line
2.19.1
Quoted 11 lines · Nathan Chancellor
After building the kernel with Clang, the following section mismatch warning appears:
WARNING:
vmlinux.o(.text+0x3bf19a6): Section mismatch in reference from the functionssc_probe()to the function .init.text:atmel_ssc_get_driver_data()
The functionssc_probe()references
the function__initatmel_ssc_get_driver_data().
This is often becausessc_probelacks a__init
annotation or the annotation ofatmel_ssc_get_driver_datais wrong.
Quoted 2 lines
Remove
__initfromatmel_ssc_get_driver_datato get rid of the mismatch.
I would add:
Quoted 7 lines
Signed-off-by Nathan Chancellor <[email protected]>---
Alternatively,
ssc_probecould be marked as__init, I don't think there is any way for the probe to defer. I decided to go with the more conservative option first but I'm happy to respin if necessary.
A probe function should never be marked __init, unless you ensure there is no way to bind/unbind the driver at runtime.
Quoted 21 lines
Thanks!
drivers/misc/atmel-ssc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/atmel-ssc.c +1
-1@@ -132,7 +132,7 @@ static const struct of_device_id atmel_ssc_dt_ids[] = {MODULE_DEVICE_TABLE (of, atmel_ssc_dt_ids);#endif -static inline const struct atmel_ssc_platform_data *__init +static inline const struct atmel_ssc_platform_data *atmel_ssc_get_driver_data (struct platform_device *pdev) {if (pdev->dev.of_node) {Signature · 1 line
2.19.1
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 24 lines · Alexandre Belloni
Quoted 11 lines · Nathan Chancellor
After building the kernel with Clang, the following section mismatch warning appears:
WARNING:
vmlinux.o(.text+0x3bf19a6): Section mismatch in reference from the functionssc_probe()to the function .init.text:atmel_ssc_get_driver_data()
The functionssc_probe()references
the function__initatmel_ssc_get_driver_data().
This is often becausessc_probelacks a__init
annotation or the annotation ofatmel_ssc_get_driver_datais wrong.Quoted 2 lines
Remove
__initfromatmel_ssc_get_driver_datato get rid of the mismatch.Reviewed-by Alexandre Belloni <[email protected]>I would add:
Fixes 5c86ac695c7e ("ASoC: atmel-ssc: use module_platform_driver macro")Quoted 3 lines
Signed-off-by Nathan Chancellor <[email protected]>---
Quoted 8 lines
Quoted 4 lines
Alternatively,
ssc_probecould be marked as__init, I don't think there is any way for the probe to defer. I decided to go with the more conservative option first but I'm happy to respin if necessary.A probe function should never be marked
__init, unless you ensure there is no way to bind/unbind the driver at runtime.
Thank you for the review and that clarification, wasn't able to find much regarding __init on probe functions in my research.
Quoted 13 lines
Quoted 13 lines
Thanks!
drivers/misc/atmel-ssc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/atmel-ssc.c +0
-0@@ -132,7 +132,7 @@ static const struct of_device_id atmel_ssc_dt_ids[] = {MODULE_DEVICE_TABLE (of, atmel_ssc_dt_ids);#endif
Quoted 13 lines
Quoted 8 lines
drivers/misc/atmel-ssc.c +1
-1-static inline const struct atmel_ssc_platform_data *__init +static inline const struct atmel_ssc_platform_data *atmel_ssc_get_driver_data (struct platform_device *pdev) {if (pdev->dev.of_node) {Signature · 1 line
2.19.1Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Cheers,
Nathan
Alexandre Belloni
maintainerQuoted 30 lines · Nathan Chancellor
Quoted 29 lines · Alexandre Belloni
Quoted 11 lines · Nathan Chancellor
After building the kernel with Clang, the following section mismatch warning appears:
WARNING:
vmlinux.o(.text+0x3bf19a6): Section mismatch in reference from the functionssc_probe()to the function .init.text:atmel_ssc_get_driver_data()
The functionssc_probe()references
the function__initatmel_ssc_get_driver_data().
This is often becausessc_probelacks a__init
annotation or the annotation ofatmel_ssc_get_driver_datais wrong.Quoted 2 lines
Remove
__initfromatmel_ssc_get_driver_datato get rid of the mismatch.Reviewed-by Alexandre Belloni <[email protected]>I would add:
Fixes 5c86ac695c7e ("ASoC: atmel-ssc: use module_platform_driver macro")Quoted 7 lines
Signed-off-by Nathan Chancellor <[email protected]>---
Alternatively,
ssc_probecould be marked as__init, I don't think there is any way for the probe to defer. I decided to go with the more conservative option first but I'm happy to respin if necessary.
Quoted 7 lines
Quoted 3 lines
A probe function should never be marked
__init, unless you ensure there is no way to bind/unbind the driver at runtime.Thank you for the review and that clarification, wasn't able to find much regarding
__initon probe functions in my research.
You can look for suppress_bind_attrs for more info.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com