Skip to contentSkip to conversation

PCI/AER: Make linux/aer.h standalone includable

PATCH Applied Thierry Reding 2 participants 2 messages Aug 5, 2014 – Sep 4, 2014 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/AER: Make linux/aer.h standalone includable

From: Thierry Reding <[email protected]>

The header file references u16, u32 and struct pci_dev types, but they are not defined in the header nor does the header pull in the necessary includes for them. This causes build breakage when the file is included without any of the dependencies being satisfied from somewhere else.

Fix this by including linux/types.h (for u16 and u32) and by adding a forward-declaration of struct pci_dev.

---
 include/linux/aer.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/aer.h +4 -0
index 4dbaa7081530..04bcf33a3e3a 100644
@@ -7,6 +7,10 @@
 #ifndef _AER_H_
 #define _AER_H_
 
+#include <linux/types.h>
+
+struct pci_dev;
+
 #define AER_NONFATAL			0
 #define AER_FATAL			1
 #define AER_CORRECTABLE			2
Signature · 1 line
2.0.4
maintainer Applied
#1 lore raw
Quoted 11 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The header file references u16, u32 and struct pci_dev types, but they are not defined in the header nor does the header pull in the necessary includes for them. This causes build breakage when the file is included without any of the dependencies being satisfied from somewhere else.

Fix this by including linux/types.h (for u16 and u32) and by adding a forward-declaration of struct pci_dev.

Applied to pci/misc for v3.18, thanks! I dropped the struct pci_dev declaration because it was already added by 5ccb8225abf2 ("x86/ras: Fix build warnings in <linux/aer.h>")

Quoted 22 lines
---
 include/linux/aer.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/aer.h +4 -0
index 4dbaa7081530..04bcf33a3e3a 100644
@@ -7,6 +7,10 @@
 #ifndef _AER_H_
 #define _AER_H_
 
+#include <linux/types.h>
+
+struct pci_dev;
+
 #define AER_NONFATAL			0
 #define AER_FATAL			1
 #define AER_CORRECTABLE			2
Signature · 1 line
2.0.4