diff mbox

[1/2] PCI: spear: Fix Section mismatch compilation warning for probe()

Message ID 76576b662613369d0c71db30ceed4ed5ae1343d2.1405857442.git.viresh.kumar@linaro.org
State Accepted
Commit 6675ef212dac43ae8474ae690e943c83449046b4
Headers show

Commit Message

Viresh Kumar July 20, 2014, 11:59 a.m. UTC
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.

Fixes: 51b66a6 (PCI: spear: Add PCIe driver for ST Microelectronics SPEAr13xx)
Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
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(-)

Comments

Olof Johansson July 20, 2014, 7:26 p.m. UTC | #1
On Sun, Jul 20, 2014 at 05:29:47PM +0530, Viresh Kumar wrote:
> 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.
> 
> 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.

> Reported-by: Olof Johansson <olof@lixom.net>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> 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
Viresh Kumar July 21, 2014, 12:12 a.m. UTC | #2
On 21 July 2014 00:56, Olof Johansson <olof@lixom.net> wrote:
> 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.
Olof Johansson July 21, 2014, 12:21 a.m. UTC | #3
On Sun, Jul 20, 2014 at 5:12 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 21 July 2014 00:56, Olof Johansson <olof@lixom.net> wrote:
>> 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
Viresh Kumar July 21, 2014, 12:27 a.m. UTC | #4
On 21 July 2014 05:51, Olof Johansson <olof@lixom.net> wrote:
> Oh, sorry, I got distracted by my kid waking up so the email was a bit short. :)

I can understand, mine is 14 months :)

> 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.
Rob Herring July 21, 2014, 2:15 a.m. UTC | #5
On Sun, Jul 20, 2014 at 7:12 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 21 July 2014 00:56, Olof Johansson <olof@lixom.net> wrote:
>> 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
Viresh Kumar July 21, 2014, 4:28 a.m. UTC | #6
On 21 July 2014 07:45, Rob Herring <robherring2@gmail.com> wrote:
> The Fixes tag is new and the format is documented in SubmittingPatches

Yeah, just saw that for the first time :)

> 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
diff mbox

Patch

diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c
index 99738e4..67315ea 100644
--- a/drivers/pci/host/pcie-spear13xx.c
+++ b/drivers/pci/host/pcie-spear13xx.c
@@ -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 = {