PCI: spear: Fix Section mismatch compilation warning for probe()
PATCH 1/2 PCI: spear: Fix Section mismatch compilation warning for probe()
Following compilation warning occurs when compiled with:CONFIG_DEBUG_SECTION_MISMATCH=y
WARNING: drivers/pci/host/built-in.o(.data+0xc0): Section mismatch in reference from the variable spear13xx_pcie_driver to the function .init.text:spear13xx_pcie_probe()
Both .probe() and pcie_init() are marked with __init, but spear13xx_pcie_driver isn't. And so section mismatch.
Fix it by marking spear13xx_pcie_driver with __initdata.
---
Olof/Arnd,
Let me know if a PULL request is required for this, otherwise just apply them directly.
drivers/pci/host/pcie-spear13xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/pcie-spear13xx.c +1 -1
@@ -382,7 +382,7 @@ static const struct of_device_id spear13xx_pcie_of_match[] = { };MODULE_DEVICE_TABLE (of, spear13xx_pcie_of_match); -static struct platform_driver spear13xx_pcie_driver = { +static struct platform_driver spear13xx_pcie_driver__initdata = { .probe = spear13xx_pcie_probe, .remove = spear13xx_pcie_remove, .driver = {
Signature · 1 line
2.0.0.rc2
PATCH 2/2 PCI: spear: Remove spear13xx_pcie_remove()
Following compilation warning occurs when compiled with:CONFIG_DEBUG_SECTION_MISMATCH=y
WARNING: vmlinux.o(.init.data+0x3338): Section mismatch in reference from the variable spear13xx_pcie_driver to the function .exit.text:spear13xx_pcie_remove()
This driver isn't allowed to unload, and so doesn't have a *_exit() routine. But it still has spear13xx_pcie_remove() marked with __exit.
As this driver can't unload, .remove() would never be called, right? So get rid of it.
--- drivers/pci/host/pcie-spear13xx.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/pci/host/pcie-spear13xx.c +0 -12
@@ -365,17 +365,6 @@ static int __init spear13xx_pcie_probe(struct platform_device *pdev)return ret; } -static int __exit spear13xx_pcie_remove(struct platform_device *pdev) -{ -struct spear13xx_pcie *spear13xx_pcie =platform_get_drvdata (pdev); - -clk_disable_unprepare (spear13xx_pcie->clk); - -phy_exit (spear13xx_pcie->phy); - -return 0 ; -} -static const struct of_device_id spear13xx_pcie_of_match[] = { { .compatible ="st,spear1340-pcie" , }, {},
@@ -384,7 +373,6 @@ MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match);static struct platform_driver spear13xx_pcie_driver__initdata = { .probe = spear13xx_pcie_probe, - .remove = spear13xx_pcie_remove, .driver = { .name ="spear-pcie" , .owner =THIS_MODULE ,
Signature · 1 line
2.0.0.rc2
PATCH 1/2 PCI: spear: Fix Section mismatch compilation warning for probe()
In reply to Viresh KumarQuoted 7 lines · Viresh Kumar
Following compilation warning occurs when compiled with:
CONFIG_DEBUG_SECTION_MISMATCH=yWARNING: drivers/pci/host/built-in.o(.data+0xc0): Section mismatch in reference from the variable
spear13xx_pcie_driverto the function .init.text:spear13xx_pcie_probe()
Quoted 6 lines
Both .probe() and
pcie_init()are marked with__init, butspear13xx_pcie_driverisn't. And so section mismatch.Fix it by marking
spear13xx_pcie_driverwith__initdata.Fixes 51b66a6 (PCI: spear: Add PCIe driver for ST Microelectronics SPEAr13xx)
Please use 12 significant digits, since 7 might not be sufficient later on in time. I've fixed it up here.
Quoted 7 lines
Reported-by Olof Johansson <[email protected]>Signed-off-by Viresh Kumar <[email protected]>---
Olof/Arnd,Let me know if a PULL request is required for this, otherwise just apply them directly.
I've applied both of these on top of next/drivers, where your previous branch was. No need for a pull request.
-Olof
PATCH 1/2 PCI: spear: Fix Section mismatch compilation warning for probe()
Quoted 2 lines · Olof Johansson
Please use 12 significant digits, since 7 might not be sufficient later on in time. I've fixed it up here.
I surely didn't knew this and haven't seen other maintainers do this as well.. And thought, whatever "git log --online" gives would be enough.
Will take care of this in future.
PATCH 1/2 PCI: spear: Fix Section mismatch compilation warning for probe()
Quoted 9 lines · Viresh Kumar
Quoted 2 lines · Olof Johansson
Please use 12 significant digits, since 7 might not be sufficient later on in time. I've fixed it up here.
I surely didn't knew this and haven't seen other maintainers do this as well.. And thought, whatever "git log --online" gives would be enough.
Will take care of this in future.
Oh, sorry, I got distracted by my kid waking up so the email was a bit short. :)
The easiest way of doing it is to switch to 12 by default. In your .gitconfig:
[core]
abbrev = 12
-Olof
PATCH 1/2 PCI: spear: Fix Section mismatch compilation warning for probe()
Quoted 1 line · Olof Johansson
Oh, sorry, I got distracted by my kid waking up so the email was a bit short. :)
I can understand, mine is 14 months :)
Quoted 4 lines
The easiest way of doing it is to switch to 12 by default. In your .gitconfig:
[core]
abbrev = 12
Oh, that will be extremely useful. Thanks.
PATCH 1/2 PCI: spear: Fix Section mismatch compilation warning for probe()
In reply to Viresh KumarQuoted 7 lines · Viresh Kumar
Quoted 2 lines · Olof Johansson
Please use 12 significant digits, since 7 might not be sufficient later on in time. I've fixed it up here.
I surely didn't knew this and haven't seen other maintainers do this as well.. And thought, whatever "git log --online" gives would be enough.
The Fixes tag is new and the format is documented in SubmittingPatches IIRC. I believe it is also supposed to be quotes rather than parentheses around the commit message if we want to be really picky.
Rob
PATCH 1/2 PCI: spear: Fix Section mismatch compilation warning for probe()
Quoted 1 line · Rob Herring
The Fixes tag is new and the format is documented in SubmittingPatches
Yeah, just saw that for the first time :)
Quoted 2 lines
IIRC. I believe it is also supposed to be quotes rather than parentheses around the commit message if we want to be really picky.
Actually both: ("$subject")
I never saw the doc and picked how it was done by Rafael for cpufreq stuff. Though he was correctly adding 12 digits of the sha key, but the quotes were missing :)
I will take care of this now.
--
viresh