diff mbox

x86/platform/intel-mid: Constify mid_pci_platform_pm

Message ID ba07572b4c4fad1f60593454693a58137f518896.1480859081.git.lukas@wunner.de
State Not Applicable
Headers show

Commit Message

Lukas Wunner Dec. 4, 2016, 2:35 p.m. UTC
This struct never needs to be modified.  The size of pci-mid.o ELF
sections changes thusly:

-.data          56
+.data           0
-.rodata        32
+.rodata        88

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---

Link to Andy's ack:
https://www.spinics.net/lists/linux-pci/msg54977.html

Link to Bjorn's ack:
https://www.spinics.net/lists/linux-pci/msg56476.html

 drivers/pci/pci-mid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bjorn Helgaas Dec. 7, 2016, 10:53 p.m. UTC | #1
On Sun, Dec 04, 2016 at 03:35:55PM +0100, Lukas Wunner wrote:
> This struct never needs to be modified.  The size of pci-mid.o ELF
> sections changes thusly:
> 
> -.data          56
> +.data           0
> -.rodata        32
> +.rodata        88
> 
> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Ingo, do you want this, since you've taken the previous updates?

It's trivial but doesn't apply cleanly to my tree, which makes me think
it might be based on other changes I don't have.

> ---
> 
> Link to Andy's ack:
> https://www.spinics.net/lists/linux-pci/msg54977.html
> 
> Link to Bjorn's ack:
> https://www.spinics.net/lists/linux-pci/msg56476.html
> 
>  drivers/pci/pci-mid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci-mid.c b/drivers/pci/pci-mid.c
> index c7f3408..1c4af72 100644
> --- a/drivers/pci/pci-mid.c
> +++ b/drivers/pci/pci-mid.c
> @@ -54,7 +54,7 @@ static bool mid_pci_need_resume(struct pci_dev *dev)
>  	return false;
>  }
>  
> -static struct pci_platform_pm_ops mid_pci_platform_pm = {
> +static const struct pci_platform_pm_ops mid_pci_platform_pm = {
>  	.is_manageable	= mid_pci_power_manageable,
>  	.set_state	= mid_pci_set_power_state,
>  	.get_state	= mid_pci_get_power_state,
> -- 
> 2.10.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ingo Molnar Dec. 12, 2016, 7:27 a.m. UTC | #2
* Bjorn Helgaas <helgaas@kernel.org> wrote:

> On Sun, Dec 04, 2016 at 03:35:55PM +0100, Lukas Wunner wrote:
> > This struct never needs to be modified.  The size of pci-mid.o ELF
> > sections changes thusly:
> > 
> > -.data          56
> > +.data           0
> > -.rodata        32
> > +.rodata        88
> > 
> > Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> 
> Ingo, do you want this, since you've taken the previous updates?
> 
> It's trivial but doesn't apply cleanly to my tree, which makes me think
> it might be based on other changes I don't have.

It applies to upstream v4.9 cleanly, so I guess it's due to other changes you have 
in your tree?

Could you take it? Me having dabbled in drivers/pci/ is more of an outlier.

Thnks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Dec. 12, 2016, 4:01 p.m. UTC | #3
On Mon, Dec 12, 2016 at 08:27:33AM +0100, Ingo Molnar wrote:
> 
> * Bjorn Helgaas <helgaas@kernel.org> wrote:
> 
> > On Sun, Dec 04, 2016 at 03:35:55PM +0100, Lukas Wunner wrote:
> > > This struct never needs to be modified.  The size of pci-mid.o ELF
> > > sections changes thusly:
> > > 
> > > -.data          56
> > > +.data           0
> > > -.rodata        32
> > > +.rodata        88
> > > 
> > > Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> > > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> > 
> > Ingo, do you want this, since you've taken the previous updates?
> > 
> > It's trivial but doesn't apply cleanly to my tree, which makes me think
> > it might be based on other changes I don't have.
> 
> It applies to upstream v4.9 cleanly, so I guess it's due to other changes you have 
> in your tree?
> 
> Could you take it? Me having dabbled in drivers/pci/ is more of an outlier.

Applied to pci/pm for v4.10.

It didn't apply cleanly to v4.9-rc1, which is what my v4.10 branches
are based on.  It applies cleanly on e8a6123e9ead
("x86/platform/intel-mid: Retrofit pci_platform_pm_ops ->get_state
hook"), which was not in v4.9-rc1 but was merged via
x86-urgent-for-linus (8528d662489a).

I can't remember why we decided to put pci-mid.c in drivers/pci.  The
obviously reason is that it uses pci_platform_pm_ops, which isn't
visible outside drivers/pci, but pci-mid.c is clearly platform-
specific, and even the name "pci_platform_pm_ops" sounds like
something that should be implemented in the arch directories, so maybe
pci_platform_pm_ops should be moved to include/linux/pci.h.

I have strange sense of déjà vu writing this, so sorry if I'm
repeating something.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Shevchenko Dec. 12, 2016, 4:11 p.m. UTC | #4
On Mon, 2016-12-12 at 10:01 -0600, Bjorn Helgaas wrote:
> On Mon, Dec 12, 2016 at 08:27:33AM +0100, Ingo Molnar wrote:

> I can't remember why we decided to put pci-mid.c in drivers/pci.

In the first place there were no such comments like below.

>   The
> obviously reason is that it uses pci_platform_pm_ops, which isn't
> visible outside drivers/pci, but pci-mid.c is clearly platform-
> specific, and even the name "pci_platform_pm_ops" sounds like
> something that should be implemented in the arch directories, so maybe
> pci_platform_pm_ops should be moved to include/linux/pci.h.

You are repeating yourself here. Last time I have referred to another
user of that struct which doesn't belong to arch, but to drivers/acpi.
And my opinion here is to keep things for now, until some common
solution would be developed.

> I have strange sense of déjà vu writing this, so sorry if I'm
> repeating something.

Yes, that's right.
diff mbox

Patch

diff --git a/drivers/pci/pci-mid.c b/drivers/pci/pci-mid.c
index c7f3408..1c4af72 100644
--- a/drivers/pci/pci-mid.c
+++ b/drivers/pci/pci-mid.c
@@ -54,7 +54,7 @@  static bool mid_pci_need_resume(struct pci_dev *dev)
 	return false;
 }
 
-static struct pci_platform_pm_ops mid_pci_platform_pm = {
+static const struct pci_platform_pm_ops mid_pci_platform_pm = {
 	.is_manageable	= mid_pci_power_manageable,
 	.set_state	= mid_pci_set_power_state,
 	.get_state	= mid_pci_get_power_state,