]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
libie: depend on DEBUG_FS when building LIBIE_FWLOG
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tue, 4 Nov 2025 17:23:31 +0000 (09:23 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Nov 2025 01:38:03 +0000 (17:38 -0800)
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: 641585bc978e ("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>
drivers/net/ethernet/intel/Kconfig
drivers/net/ethernet/intel/ixgbe/ixgbe.h
include/linux/net/intel/libie/fwlog.h

index a563a94e27802a8ac7971dcdcbcfc73260712445..122ee23497e6a503723e002f85de06fdd7d60dcc 100644 (file)
@@ -146,7 +146,7 @@ config IXGBE
        tristate "Intel(R) 10GbE PCI Express adapters support"
        depends on PCI
        depends on PTP_1588_CLOCK_OPTIONAL
-       select LIBIE_FWLOG
+       select LIBIE_FWLOG if DEBUG_FS
        select MDIO
        select NET_DEVLINK
        select PLDMFW
@@ -298,7 +298,7 @@ config ICE
        select DIMLIB
        select LIBIE
        select LIBIE_ADMINQ
-       select LIBIE_FWLOG
+       select LIBIE_FWLOG if DEBUG_FS
        select NET_DEVLINK
        select PACKING
        select PLDMFW
index 14d2752701238b2036959fc381cdf0f08f57d87f..dce4936708eb4402d3573bbfd4a869dcc7d560e5 100644 (file)
@@ -821,9 +821,7 @@ struct ixgbe_adapter {
 #ifdef CONFIG_IXGBE_HWMON
        struct hwmon_buff *ixgbe_hwmon_buff;
 #endif /* CONFIG_IXGBE_HWMON */
-#ifdef CONFIG_DEBUG_FS
        struct dentry *ixgbe_dbg_adapter;
-#endif /*CONFIG_DEBUG_FS*/
 
        u8 default_up;
        /* Bitmask indicating in use pools */
index 36b13fabca9ec2a5956dbf843287b17de61c9d0a..7273c78c826b404bccd49765ddbba8fcb2798074 100644 (file)
@@ -78,8 +78,20 @@ struct libie_fwlog {
        );
 };
 
+#if IS_ENABLED(CONFIG_LIBIE_FWLOG)
 int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api);
 void libie_fwlog_deinit(struct libie_fwlog *fwlog);
 void libie_fwlog_reregister(struct libie_fwlog *fwlog);
 void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len);
+#else
+static inline int libie_fwlog_init(struct libie_fwlog *fwlog,
+                                  struct libie_fwlog_api *api)
+{
+       return -EOPNOTSUPP;
+}
+static inline void libie_fwlog_deinit(struct libie_fwlog *fwlog) { }
+static inline void libie_fwlog_reregister(struct libie_fwlog *fwlog) { }
+static inline void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf,
+                                       u16 len) { }
+#endif /* CONFIG_LIBIE_FWLOG */
 #endif /* _LIBIE_FWLOG_H_ */