Skip to content

Commit b1d16f7

Browse files
Michal Swiatkowskikuba-moo
authored andcommitted
libie: depend on DEBUG_FS when building LIBIE_FWLOG
LIBIE_FWLOG is unusable without DEBUG_FS. Mark it in Kconfig. Fix build error on ixgbe when DEBUG_FS is not set. To not add another layer of #if IS_ENABLED(LIBIE_FWLOG) in ixgbe fwlog code define debugfs dentry even when DEBUG_FS isn't enabled. In this case the dummy functions of LIBIE_FWLOG will be used, so not initialized dentry isn't a problem. Fixes: 641585b ("ixgbe: fwlog support for e610") Reported-by: Guenter Roeck <linux@roeck-us.net> Closes: https://lore.kernel.org/lkml/f594c621-f9e1-49f2-af31-23fbcb176058@roeck-us.net/ Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Link: https://patch.msgid.link/20251104172333.752445-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 327c20c commit b1d16f7

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

drivers/net/ethernet/intel/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ config IXGBE
146146
tristate "Intel(R) 10GbE PCI Express adapters support"
147147
depends on PCI
148148
depends on PTP_1588_CLOCK_OPTIONAL
149-
select LIBIE_FWLOG
149+
select LIBIE_FWLOG if DEBUG_FS
150150
select MDIO
151151
select NET_DEVLINK
152152
select PLDMFW
@@ -298,7 +298,7 @@ config ICE
298298
select DIMLIB
299299
select LIBIE
300300
select LIBIE_ADMINQ
301-
select LIBIE_FWLOG
301+
select LIBIE_FWLOG if DEBUG_FS
302302
select NET_DEVLINK
303303
select PACKING
304304
select PLDMFW

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,9 +821,7 @@ struct ixgbe_adapter {
821821
#ifdef CONFIG_IXGBE_HWMON
822822
struct hwmon_buff *ixgbe_hwmon_buff;
823823
#endif /* CONFIG_IXGBE_HWMON */
824-
#ifdef CONFIG_DEBUG_FS
825824
struct dentry *ixgbe_dbg_adapter;
826-
#endif /*CONFIG_DEBUG_FS*/
827825

828826
u8 default_up;
829827
/* Bitmask indicating in use pools */

include/linux/net/intel/libie/fwlog.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,20 @@ struct libie_fwlog {
7878
);
7979
};
8080

81+
#if IS_ENABLED(CONFIG_LIBIE_FWLOG)
8182
int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api);
8283
void libie_fwlog_deinit(struct libie_fwlog *fwlog);
8384
void libie_fwlog_reregister(struct libie_fwlog *fwlog);
8485
void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len);
86+
#else
87+
static inline int libie_fwlog_init(struct libie_fwlog *fwlog,
88+
struct libie_fwlog_api *api)
89+
{
90+
return -EOPNOTSUPP;
91+
}
92+
static inline void libie_fwlog_deinit(struct libie_fwlog *fwlog) { }
93+
static inline void libie_fwlog_reregister(struct libie_fwlog *fwlog) { }
94+
static inline void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf,
95+
u16 len) { }
96+
#endif /* CONFIG_LIBIE_FWLOG */
8597
#endif /* _LIBIE_FWLOG_H_ */

0 commit comments

Comments
 (0)