All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PCI: cpcihp: Move declaration of cpci_debug to the header file
@ 2021-07-01 18:43 Krzysztof Wilczyński
  2021-07-01 20:36 ` Bjorn Helgaas
  2021-07-01 22:10 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2021-07-01 18:43 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Scott Murray, linux-pci

At the moment, the global variable cpci_debug is declared in the
cpci_hotplug_core.c file.  Since this variable has users outside of this
file and uses the extern keyword to change its visibility, move the
variable declaration to the header file.

This resolves the following sparse warning:

  drivers/pci/hotplug/cpci_hotplug_core.c:47:5: warning: symbol 'cpci_debug' was not declared. Should it be static?

Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
Changes in v2:
  Remove hunk that incorrectly removed definition of the cpci_debug
  variable.

 drivers/pci/hotplug/cpci_hotplug.h     | 3 +++
 drivers/pci/hotplug/cpci_hotplug_pci.c | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
index f33ff2bca414..3fdd1b9bd8c3 100644
--- a/drivers/pci/hotplug/cpci_hotplug.h
+++ b/drivers/pci/hotplug/cpci_hotplug.h
@@ -75,6 +75,9 @@ int cpci_hp_unregister_bus(struct pci_bus *bus);
 int cpci_hp_start(void);
 int cpci_hp_stop(void);
 
+/* Global variables */
+extern int cpci_debug;
+
 /*
  * Internal function prototypes, these functions should not be used by
  * board/chassis drivers.
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 2c16adb7f4ec..6c48066acb44 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -19,8 +19,6 @@
 
 #define MY_NAME	"cpci_hotplug"
 
-extern int cpci_debug;
-
 #define dbg(format, arg...)					\
 	do {							\
 		if (cpci_debug)					\
-- 
2.32.0


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

* Re: [PATCH v2] PCI: cpcihp: Move declaration of cpci_debug to the header file
  2021-07-01 18:43 [PATCH v2] PCI: cpcihp: Move declaration of cpci_debug to the header file Krzysztof Wilczyński
@ 2021-07-01 20:36 ` Bjorn Helgaas
  2021-07-01 22:10 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2021-07-01 20:36 UTC (permalink / raw)
  To: Krzysztof Wilczyński; +Cc: Bjorn Helgaas, Scott Murray, linux-pci

On Thu, Jul 01, 2021 at 06:43:06PM +0000, Krzysztof Wilczyński wrote:
> At the moment, the global variable cpci_debug is declared in the
> cpci_hotplug_core.c file.  Since this variable has users outside of this
> file and uses the extern keyword to change its visibility, move the
> variable declaration to the header file.
> 
> This resolves the following sparse warning:
> 
>   drivers/pci/hotplug/cpci_hotplug_core.c:47:5: warning: symbol 'cpci_debug' was not declared. Should it be static?
> 
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>

Applied to pci/hotplug for v5.14, thanks!

> ---
> Changes in v2:
>   Remove hunk that incorrectly removed definition of the cpci_debug
>   variable.
> 
>  drivers/pci/hotplug/cpci_hotplug.h     | 3 +++
>  drivers/pci/hotplug/cpci_hotplug_pci.c | 2 --
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
> index f33ff2bca414..3fdd1b9bd8c3 100644
> --- a/drivers/pci/hotplug/cpci_hotplug.h
> +++ b/drivers/pci/hotplug/cpci_hotplug.h
> @@ -75,6 +75,9 @@ int cpci_hp_unregister_bus(struct pci_bus *bus);
>  int cpci_hp_start(void);
>  int cpci_hp_stop(void);
>  
> +/* Global variables */
> +extern int cpci_debug;
> +
>  /*
>   * Internal function prototypes, these functions should not be used by
>   * board/chassis drivers.
> diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
> index 2c16adb7f4ec..6c48066acb44 100644
> --- a/drivers/pci/hotplug/cpci_hotplug_pci.c
> +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
> @@ -19,8 +19,6 @@
>  
>  #define MY_NAME	"cpci_hotplug"
>  
> -extern int cpci_debug;
> -
>  #define dbg(format, arg...)					\
>  	do {							\
>  		if (cpci_debug)					\
> -- 
> 2.32.0
> 

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

* Re: [PATCH v2] PCI: cpcihp: Move declaration of cpci_debug to the header file
  2021-07-01 18:43 [PATCH v2] PCI: cpcihp: Move declaration of cpci_debug to the header file Krzysztof Wilczyński
  2021-07-01 20:36 ` Bjorn Helgaas
@ 2021-07-01 22:10 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2021-07-01 22:10 UTC (permalink / raw)
  To: Krzysztof Wilczyński; +Cc: Bjorn Helgaas, Scott Murray, linux-pci

On Thu, Jul 01, 2021 at 06:43:06PM +0000, Krzysztof Wilczyński wrote:
> At the moment, the global variable cpci_debug is declared in the
> cpci_hotplug_core.c file.  Since this variable has users outside of this
> file and uses the extern keyword to change its visibility, move the
> variable declaration to the header file.
> 
> This resolves the following sparse warning:
> 
>   drivers/pci/hotplug/cpci_hotplug_core.c:47:5: warning: symbol 'cpci_debug' was not declared. Should it be static?
> 
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>

Applied to pci/hotplug for v5.14, thanks!

> ---
> Changes in v2:
>   Remove hunk that incorrectly removed definition of the cpci_debug
>   variable.
> 
>  drivers/pci/hotplug/cpci_hotplug.h     | 3 +++
>  drivers/pci/hotplug/cpci_hotplug_pci.c | 2 --
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
> index f33ff2bca414..3fdd1b9bd8c3 100644
> --- a/drivers/pci/hotplug/cpci_hotplug.h
> +++ b/drivers/pci/hotplug/cpci_hotplug.h
> @@ -75,6 +75,9 @@ int cpci_hp_unregister_bus(struct pci_bus *bus);
>  int cpci_hp_start(void);
>  int cpci_hp_stop(void);
>  
> +/* Global variables */
> +extern int cpci_debug;
> +
>  /*
>   * Internal function prototypes, these functions should not be used by
>   * board/chassis drivers.
> diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
> index 2c16adb7f4ec..6c48066acb44 100644
> --- a/drivers/pci/hotplug/cpci_hotplug_pci.c
> +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
> @@ -19,8 +19,6 @@
>  
>  #define MY_NAME	"cpci_hotplug"
>  
> -extern int cpci_debug;
> -
>  #define dbg(format, arg...)					\
>  	do {							\
>  		if (cpci_debug)					\
> -- 
> 2.32.0
> 

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

end of thread, other threads:[~2021-07-01 22:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 18:43 [PATCH v2] PCI: cpcihp: Move declaration of cpci_debug to the header file Krzysztof Wilczyński
2021-07-01 20:36 ` Bjorn Helgaas
2021-07-01 22:10 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.