Skip to contentSkip to conversation

PCI/AER: Forward declare struct pci_dev to avoid warning

PATCH In review Tuomas Tynkkynen 3 participants 3 messages Jul 21, 2014 – Jul 22, 2014 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/AER: Forward declare struct pci_dev to avoid warning

Forward declaring struct pci_dev in aer.h avoids this warning:

In file included from include/ras/ras_event.h:11:0,

                 from drivers/ras/ras.c:13:

include/linux/aer.h:38:44: warning: 'struct pci_dev’ declared inside parameter list [enabled by default] include/linux/aer.h:38:44: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

---
 include/linux/aer.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/aer.h +2 -0
index 4dbaa70..d9ec8dd 100644
@@ -7,6 +7,8 @@
 #ifndef _AER_H_
 #define _AER_H_
 
+struct pci_dev;
+
 #define AER_NONFATAL			0
 #define AER_FATAL			1
 #define AER_CORRECTABLE			2
Signature · 1 line
1.8.1.5
#1 lore raw

On Mon, Jul 21, 2014 at 07:30:43PM +0300, Tuomas Tynkkynen wrote:

I guess it's same issue and fix as:

http://patchwork.ozlabs.org/patch/370629/

Thanks,
Gavin

Quoted 33 lines

Forward declaring struct pci_dev in aer.h avoids this warning:

In file included from include/ras/ras_event.h:11:0,

                from drivers/ras/ras.c:13:

include/linux/aer.h:38:44: warning: 'struct pci_dev’ declared inside parameter list [enabled by default] include/linux/aer.h:38:44: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

---
include/linux/aer.h | 2 ++

1 file changed, 2 insertions(+)
include/linux/aer.h +2 -0
index 4dbaa70..d9ec8dd 100644
@@ -7,6 +7,8 @@
 #ifndef _AER_H_
 #define _AER_H_
 
+struct pci_dev;
+
 #define AER_NONFATAL			0
 #define AER_FATAL			1
 #define AER_CORRECTABLE			2
Signature · 6 lines
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 5 lines · Gavin Shan

On Mon, Jul 21, 2014 at 07:30:43PM +0300, Tuomas Tynkkynen wrote:

I guess it's same issue and fix as:

http://patchwork.ozlabs.org/patch/370629/

Yes, and it still needs to be merged.... :(

Quoted 29 lines

Thanks,
Gavin

Quoted 26 lines

Forward declaring struct pci_dev in aer.h avoids this warning:

In file included from include/ras/ras_event.h:11:0,

                from drivers/ras/ras.c:13:

include/linux/aer.h:38:44: warning: 'struct pci_dev’ declared inside parameter list [enabled by default] include/linux/aer.h:38:44: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]

---
include/linux/aer.h | 2 ++

1 file changed, 2 insertions(+)
include/linux/aer.h +2 -0
index 4dbaa70..d9ec8dd 100644
@@ -7,6 +7,8 @@
 #ifndef _AER_H_
 #define _AER_H_
 
+struct pci_dev;
+
 #define AER_NONFATAL			0
 #define AER_FATAL			1
 #define AER_CORRECTABLE			2
Signature · 1 line
~Randy