Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1734275 > unrolled thread

[PATCH] x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst

Started byBhumika Goyal <bhumirks@gmail.com>
First post2017-09-18 18:30 +0200
Last post2017-09-19 21:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst Bhumika Goyal <bhumirks@gmail.com> - 2017-09-18 18:30 +0200
    Re: [PATCH] x86/pci/intel_mid_pci: make intel_mid_pci_ops const and  __initconst Bjorn Helgaas <helgaas@kernel.org> - 2017-09-19 21:50 +0200

#1734275 — [PATCH] x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst

FromBhumika Goyal <bhumirks@gmail.com>
Date2017-09-18 18:30 +0200
Subject[PATCH] x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst
Message-ID<ur75L-b2-1@gated-at.bofh.it>
Make this const as it is only used during a copy operation. This usage
is inside init function and the structure is not referenced after
initialisation, so make it __initconst too.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 arch/x86/pci/intel_mid_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
index b901ece..63fbe8f 100644
--- a/arch/x86/pci/intel_mid_pci.c
+++ b/arch/x86/pci/intel_mid_pci.c
@@ -279,7 +279,7 @@ static void intel_mid_pci_irq_disable(struct pci_dev *dev)
 	}
 }
 
-static struct pci_ops intel_mid_pci_ops = {
+static const struct pci_ops intel_mid_pci_ops __initconst = {
 	.read = pci_read,
 	.write = pci_write,
 };
-- 
1.9.1

[toc] | [next] | [standalone]


#1735192 — Re: [PATCH] x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst

FromBjorn Helgaas <helgaas@kernel.org>
Date2017-09-19 21:50 +0200
SubjectRe: [PATCH] x86/pci/intel_mid_pci: make intel_mid_pci_ops const and __initconst
Message-ID<urwGR-1aF-7@gated-at.bofh.it>
In reply to#1734275
On Mon, Sep 18, 2017 at 09:54:55PM +0530, Bhumika Goyal wrote:
> Make this const as it is only used during a copy operation. This usage
> is inside init function and the structure is not referenced after
> initialisation, so make it __initconst too.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

I applied this to pci/misc for v4.15, thanks!

If this conflicts with patches going via x86, I'll gladly drop it from my
tree; just let me know.

> ---
>  arch/x86/pci/intel_mid_pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
> index b901ece..63fbe8f 100644
> --- a/arch/x86/pci/intel_mid_pci.c
> +++ b/arch/x86/pci/intel_mid_pci.c
> @@ -279,7 +279,7 @@ static void intel_mid_pci_irq_disable(struct pci_dev *dev)
>  	}
>  }
>  
> -static struct pci_ops intel_mid_pci_ops = {
> +static const struct pci_ops intel_mid_pci_ops __initconst = {
>  	.read = pci_read,
>  	.write = pci_write,
>  };
> -- 
> 1.9.1
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web