linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c
@ 2019-08-26 15:14 Krzysztof Wilczynski
  2019-08-27 23:30 ` Bjorn Helgaas
  2019-08-28 13:17 ` [PATCH v2] " Krzysztof Wilczynski
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Wilczynski @ 2019-08-26 15:14 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel

Move the static keyword to the front of declarations of
pci_regs_behavior and pcie_cap_regs_behavior, and resolve
compiler warning that can be seen when building with
warnings enabled (W=1).

Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
---
 drivers/pci/pci-bridge-emul.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci-bridge-emul.c b/drivers/pci/pci-bridge-emul.c
index 06083b86d4f4..5fd90105510d 100644
--- a/drivers/pci/pci-bridge-emul.c
+++ b/drivers/pci/pci-bridge-emul.c
@@ -38,7 +38,7 @@ struct pci_bridge_reg_behavior {
 	u32 rsvd;
 };
 
-const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
+static const struct pci_bridge_reg_behavior pci_regs_behavior[] = {
 	[PCI_VENDOR_ID / 4] = { .ro = ~0 },
 	[PCI_COMMAND / 4] = {
 		.rw = (PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
@@ -173,7 +173,7 @@ const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
 	},
 };
 
-const static struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
+static const struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
 	[PCI_CAP_LIST_ID / 4] = {
 		/*
 		 * Capability ID, Next Capability Pointer and
-- 
2.22.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c
  2019-08-26 15:14 [PATCH] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c Krzysztof Wilczynski
@ 2019-08-27 23:30 ` Bjorn Helgaas
  2019-08-28  7:01   ` Thomas Petazzoni
  2019-08-28 10:23   ` Krzysztof Wilczynski
  2019-08-28 13:17 ` [PATCH v2] " Krzysztof Wilczynski
  1 sibling, 2 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2019-08-27 23:30 UTC (permalink / raw)
  To: Krzysztof Wilczynski; +Cc: linux-pci, linux-kernel, Thomas Petazzoni

[+cc Thomas]

On Mon, Aug 26, 2019 at 05:14:36PM +0200, Krzysztof Wilczynski wrote:
> Move the static keyword to the front of declarations of
> pci_regs_behavior and pcie_cap_regs_behavior, and resolve
> compiler warning that can be seen when building with
> warnings enabled (W=1).

It would be useful to include the compiler warning in the commit log.

I notice there are a few similar occurrences elsewhere in the tree:

  arch/csky/kernel/perf_event.c:const static struct of_device_id csky_pmu_of_device_ids[] = {
  arch/nds32/kernel/perf_event_cpu.c:const static struct of_device_id cpu_pmu_of_device_ids[] = {
  drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
  drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct msm_dsi_host_cfg_ops msm_dsi_6g_host_ops = {
  drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct msm_dsi_host_cfg_ops msm_dsi_6g_v2_host_ops = {
  drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:const static struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = {
  fs/unicode/utf8-selftest.c:const static struct {
  fs/unicode/utf8-selftest.c:const static struct {

Those should probably be fixed, too (but in separate patches since
other maintainers would take them).

> Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
> ---
>  drivers/pci/pci-bridge-emul.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pci-bridge-emul.c b/drivers/pci/pci-bridge-emul.c
> index 06083b86d4f4..5fd90105510d 100644
> --- a/drivers/pci/pci-bridge-emul.c
> +++ b/drivers/pci/pci-bridge-emul.c
> @@ -38,7 +38,7 @@ struct pci_bridge_reg_behavior {
>  	u32 rsvd;
>  };
>  
> -const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
> +static const struct pci_bridge_reg_behavior pci_regs_behavior[] = {
>  	[PCI_VENDOR_ID / 4] = { .ro = ~0 },
>  	[PCI_COMMAND / 4] = {
>  		.rw = (PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
> @@ -173,7 +173,7 @@ const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
>  	},
>  };
>  
> -const static struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
> +static const struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
>  	[PCI_CAP_LIST_ID / 4] = {
>  		/*
>  		 * Capability ID, Next Capability Pointer and
> -- 
> 2.22.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c
  2019-08-27 23:30 ` Bjorn Helgaas
@ 2019-08-28  7:01   ` Thomas Petazzoni
  2019-08-28 10:23   ` Krzysztof Wilczynski
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2019-08-28  7:01 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Krzysztof Wilczynski, linux-pci, linux-kernel

Hello,

On Tue, 27 Aug 2019 18:30:17 -0500
Bjorn Helgaas <helgaas@kernel.org> wrote:

> [+cc Thomas]
> 
> On Mon, Aug 26, 2019 at 05:14:36PM +0200, Krzysztof Wilczynski wrote:
> > Move the static keyword to the front of declarations of
> > pci_regs_behavior and pcie_cap_regs_behavior, and resolve
> > compiler warning that can be seen when building with
> > warnings enabled (W=1).  
> 
> It would be useful to include the compiler warning in the commit log.
> 
> I notice there are a few similar occurrences elsewhere in the tree:
> 
>   arch/csky/kernel/perf_event.c:const static struct of_device_id csky_pmu_of_device_ids[] = {
>   arch/nds32/kernel/perf_event_cpu.c:const static struct of_device_id cpu_pmu_of_device_ids[] = {
>   drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
>   drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct msm_dsi_host_cfg_ops msm_dsi_6g_host_ops = {
>   drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct msm_dsi_host_cfg_ops msm_dsi_6g_v2_host_ops = {
>   drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:const static struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = {
>   fs/unicode/utf8-selftest.c:const static struct {
>   fs/unicode/utf8-selftest.c:const static struct {
> 
> Those should probably be fixed, too (but in separate patches since
> other maintainers would take them).
> 
> > Signed-off-by: Krzysztof Wilczynski <kw@linux.com>

Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c
  2019-08-27 23:30 ` Bjorn Helgaas
  2019-08-28  7:01   ` Thomas Petazzoni
@ 2019-08-28 10:23   ` Krzysztof Wilczynski
  1 sibling, 0 replies; 6+ messages in thread
From: Krzysztof Wilczynski @ 2019-08-28 10:23 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel, Thomas Petazzoni

Hello Bjorn and Thomas,

Thank you for the feedback.

[...]
>>  Move the static keyword to the front of declarations of
>>  pci_regs_behavior and pcie_cap_regs_behavior, and resolve
>>  compiler warning that can be seen when building with
>>  warnings enabled (W=1).
> 
> It would be useful to include the compiler warning in the commit log.

Good point.  Sorry about that.  I will send a v2 that includes
updated commit message.

> I notice there are a few similar occurrences elsewhere in the tree:
> 
>   arch/csky/kernel/perf_event.c:const static struct of_device_id 
> csky_pmu_of_device_ids[] = {
>   arch/nds32/kernel/perf_event_cpu.c:const static struct of_device_id 
> cpu_pmu_of_device_ids[] = {
>   drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct 
> msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
>   drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct 
> msm_dsi_host_cfg_ops msm_dsi_6g_host_ops = {
>   drivers/gpu/drm/msm/dsi/dsi_cfg.c:const static struct 
> msm_dsi_host_cfg_ops msm_dsi_6g_v2_host_ops = {
>   drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:const static 
> struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = {
>   fs/unicode/utf8-selftest.c:const static struct {
>   fs/unicode/utf8-selftest.c:const static struct {
> 
> Those should probably be fixed, too (but in separate patches since
> other maintainers would take them).

I will take care about these too.

Krzysztof



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c
  2019-08-26 15:14 [PATCH] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c Krzysztof Wilczynski
  2019-08-27 23:30 ` Bjorn Helgaas
@ 2019-08-28 13:17 ` Krzysztof Wilczynski
  2019-08-28 13:39   ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Wilczynski @ 2019-08-28 13:17 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Thomas Petazzoni, linux-pci, linux-kernel

Move the static keyword to the front of declarations of
pci_regs_behavior and pcie_cap_regs_behavior, and resolve
the following compiler warning that can be seen when
building with warnings enabled (W=1):

drivers/pci/pci-bridge-emul.c:41:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
 const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
 ^
drivers/pci/pci-bridge-emul.c:176:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
 const static struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
 ^

Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
---
Changes in v2:
  Update commit message to include compiler warning.

 drivers/pci/pci-bridge-emul.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci-bridge-emul.c b/drivers/pci/pci-bridge-emul.c
index 06083b86d4f4..5fd90105510d 100644
--- a/drivers/pci/pci-bridge-emul.c
+++ b/drivers/pci/pci-bridge-emul.c
@@ -38,7 +38,7 @@ struct pci_bridge_reg_behavior {
 	u32 rsvd;
 };
 
-const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
+static const struct pci_bridge_reg_behavior pci_regs_behavior[] = {
 	[PCI_VENDOR_ID / 4] = { .ro = ~0 },
 	[PCI_COMMAND / 4] = {
 		.rw = (PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
@@ -173,7 +173,7 @@ const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
 	},
 };
 
-const static struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
+static const struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
 	[PCI_CAP_LIST_ID / 4] = {
 		/*
 		 * Capability ID, Next Capability Pointer and
-- 
2.22.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c
  2019-08-28 13:17 ` [PATCH v2] " Krzysztof Wilczynski
@ 2019-08-28 13:39   ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2019-08-28 13:39 UTC (permalink / raw)
  To: Krzysztof Wilczynski; +Cc: Bjorn Helgaas, linux-pci, linux-kernel

Hello,

On Wed, 28 Aug 2019 15:17:33 +0200
Krzysztof Wilczynski <kw@linux.com> wrote:

> Move the static keyword to the front of declarations of
> pci_regs_behavior and pcie_cap_regs_behavior, and resolve
> the following compiler warning that can be seen when
> building with warnings enabled (W=1):
> 
> drivers/pci/pci-bridge-emul.c:41:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static struct pci_bridge_reg_behavior pci_regs_behavior[] = {
>  ^
> drivers/pci/pci-bridge-emul.c:176:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>  const static struct pci_bridge_reg_behavior pcie_cap_regs_behavior[] = {
>  ^
> 
> Signed-off-by: Krzysztof Wilczynski <kw@linux.com>

Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-28 13:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26 15:14 [PATCH] PCI: Move static keyword to the front of declarations in pci-bridge-emul.c Krzysztof Wilczynski
2019-08-27 23:30 ` Bjorn Helgaas
2019-08-28  7:01   ` Thomas Petazzoni
2019-08-28 10:23   ` Krzysztof Wilczynski
2019-08-28 13:17 ` [PATCH v2] " Krzysztof Wilczynski
2019-08-28 13:39   ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).