e1000e: Fix duplicate include guard
Subsystems (3)
PATCH 1/2 e1000e: Fix duplicate include guard
The include guard "_E1000_HW_H_" is used by header files in three different drivers (e1000/e1000_hw.h, e1000e/hw.h, and igb/e1000_hw.h). Using the same include guard macro in more than one header file may cause unexpected behavior from the compiler. Fix the duplicate include guard in the e1000e driver by renaming it.
--- drivers/net/ethernet/intel/e1000e/hw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/e1000e/hw.h +3 -3
@@ -1,8 +1,8 @@/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright(c) 1999 - 2018 Intel Corporation. */ -#ifndef _E1000_HW_H_ -#define _E1000_HW_H_ +#ifndef _E1000E_HW_H_ +#define _E1000E_HW_H_#include "regs.h" #include "defines.h"
@@ -714,4 +714,4 @@ struct e1000_hw {#include "80003es2lan.h" #include "ich8lan.h" -#endif +#endif /* _E1000E_HW_H_ */
Signature · 1 line
2.20.1
PATCH 2/2 igb: Fix duplicate include guard
The include guard "_E1000_HW_H_" is used by two separate header files in two different drivers (e1000/e1000_hw.h and igb/e1000_hw.h). Using the same include guard macro in more than one header file may cause unexpected behavior from the compiler. Fix this by renaming the duplicate guard in the igb driver.
--- drivers/net/ethernet/intel/igb/e1000_hw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igb/e1000_hw.h +3 -3
@@ -1,8 +1,8 @@/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright(c) 2007 - 2018 Intel Corporation. */ -#ifndef _E1000_HW_H_ -#define _E1000_HW_H_ +#ifndef _E1000_IGB_HW_H_ +#define _E1000_IGB_HW_H_#include <linux/types.h> #include <linux/delay.h>
@@ -551,4 +551,4 @@ s32 igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);void igb_read_pci_cfg (struct e1000_hw *hw,u32 reg,u16 *value);void igb_write_pci_cfg (struct e1000_hw *hw,u32 reg,u16 *value); -#endif /* _E1000_HW_H_ */ +#endif /* _E1000_IGB_HW_H_ */
Signature · 1 line
2.20.1
Re: [PATCH net 2/2] igb: Fix duplicate include guard
Quoted 8 lines · Tom Seewald
The include guard "_E1000_HW_H_" is used by two separate header files in two different drivers (
e1000/e1000_hw.handigb/e1000_hw.h). Using the same include guard macro in more than one header file may cause unexpected behavior from the compiler. Fix this by renaming the duplicate guard in the igb driver.Fixes 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver")Signed-off-by Tom Seewald <[email protected]>
Change is simple and makes sense.
Quoted 29 lines · Tom Seewald
The include guard "_E1000_HW_H_" is used by header files in three different drivers (
e1000/e1000_hw.h,e1000e/hw.h, andigb/e1000_hw.h). Using the same include guard macro in more than one header file may cause unexpected behavior from the compiler. Fix the duplicate include guard in the e1000e driver by renaming it.Fixes bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")Signed-off-by Tom Seewald <[email protected]>--- drivers/net/ethernet/intel/e1000e/hw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/ethernet/intel/e1000e/hw.h +2
-2@@ -1,8 +1,8 @@/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright(c) 1999 - 2018 Intel Corporation. */ -#ifndef _E1000_HW_H_ -#define _E1000_HW_H_ +#ifndef _E1000E_HW_H_ +#define _E1000E_HW_H_#include "regs.h" #include "defines.h"
drivers/net/ethernet/intel/e1000e/hw.h struct e1000_hw { · line 717
Quoted 5 lines
drivers/net/ethernet/intel/e1000e/hw.h +1
-1@@ -714,4 +714,4 @@ struct e1000_hw {#include "80003es2lan.h" #include "ich8lan.h" -#endif +#endif /* _E1000E_HW_H_ */
Quoted 29 lines · Tom Seewald
The include guard "_E1000_HW_H_" is used by header files in three different drivers (
e1000/e1000_hw.h,e1000e/hw.h, andigb/e1000_hw.h). Using the same include guard macro in more than one header file may cause unexpected behavior from the compiler. Fix the duplicate include guard in the e1000e driver by renaming it.Fixes bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")Signed-off-by Tom Seewald <[email protected]>--- drivers/net/ethernet/intel/e1000e/hw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/ethernet/intel/e1000e/hw.h +2
-2@@ -1,8 +1,8 @@/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright(c) 1999 - 2018 Intel Corporation. */ -#ifndef _E1000_HW_H_ -#define _E1000_HW_H_ +#ifndef _E1000E_HW_H_ +#define _E1000E_HW_H_#include "regs.h" #include "defines.h"
drivers/net/ethernet/intel/e1000e/hw.h struct e1000_hw { · line 717
Quoted 5 lines
drivers/net/ethernet/intel/e1000e/hw.h +1
-1@@ -714,4 +714,4 @@ struct e1000_hw {#include "80003es2lan.h" #include "ich8lan.h" -#endif +#endif /* _E1000E_HW_H_ */