[PATCH] xen-platform: Constify dev_pm_ops

Rikard Falkeborn posted 1 patch 3 years, 11 months ago
Failed in applying to current master (apply log)
drivers/xen/platform-pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] xen-platform: Constify dev_pm_ops
Posted by Rikard Falkeborn 3 years, 11 months ago
dev_pm_ops is never modified, so mark it const to allow the compiler to
put it in read-only memory.

Before:
   text    data     bss     dec     hex filename
   2457    1668     256    4381    111d drivers/xen/platform-pci.o

After:
   text    data     bss     dec     hex filename
   2681    1444     256    4381    111d drivers/xen/platform-pci.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/xen/platform-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 59e85e408c23..dd911e1ff782 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -168,7 +168,7 @@ static const struct pci_device_id platform_pci_tbl[] = {
 	{0,}
 };
 
-static struct dev_pm_ops platform_pm_ops = {
+static const struct dev_pm_ops platform_pm_ops = {
 	.resume_noirq =   platform_pci_resume,
 };
 
-- 
2.26.2


Re: [PATCH] xen-platform: Constify dev_pm_ops
Posted by Jürgen Groß 3 years, 11 months ago
On 09.05.20 15:47, Rikard Falkeborn wrote:
> dev_pm_ops is never modified, so mark it const to allow the compiler to
> put it in read-only memory.
> 
> Before:
>     text    data     bss     dec     hex filename
>     2457    1668     256    4381    111d drivers/xen/platform-pci.o
> 
> After:
>     text    data     bss     dec     hex filename
>     2681    1444     256    4381    111d drivers/xen/platform-pci.o
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen