fm10k: conditionally compile DCB and DebugFS support
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 27 Oct 2015 19:51:09 +0000 (12:51 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sun, 13 Dec 2015 23:27:59 +0000 (15:27 -0800)
Rather than wrapping fm10k_dcbnl.c and fm10k_debugfs.c support with
 #ifdef blocks, just conditionally include the .o files in the Makefile.
Also, since we're modifying it, update the copyright year on the
Makefile.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/Makefile
drivers/net/ethernet/intel/fm10k/fm10k.h
drivers/net/ethernet/intel/fm10k/fm10k_dcbnl.c
drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c

index 08859dd..b006ff6 100644 (file)
@@ -1,7 +1,7 @@
 ################################################################################
 #
 # Intel Ethernet Switch Host Interface Driver
-# Copyright(c) 2013 - 2014 Intel Corporation.
+# Copyright(c) 2013 - 2015 Intel Corporation.
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the terms and conditions of the GNU General Public License,
 
 obj-$(CONFIG_FM10K) += fm10k.o
 
-fm10k-objs := fm10k_main.o fm10k_common.o fm10k_pci.o \
-             fm10k_netdev.o fm10k_ethtool.o fm10k_pf.o fm10k_vf.o \
-             fm10k_mbx.o fm10k_iov.o fm10k_tlv.o \
-             fm10k_debugfs.o fm10k_ptp.o fm10k_dcbnl.o
+fm10k-y := fm10k_main.o \
+          fm10k_common.o \
+          fm10k_pci.o \
+          fm10k_ptp.o \
+          fm10k_netdev.o \
+          fm10k_ethtool.o \
+          fm10k_pf.o \
+          fm10k_vf.o \
+          fm10k_mbx.o \
+          fm10k_iov.o \
+          fm10k_tlv.o
+
+fm10k-$(CONFIG_DEBUG_FS) += fm10k_debugfs.o
+fm10k-$(CONFIG_DCB) += fm10k_dcbnl.o
index 8595a3d..02219d9 100644 (file)
@@ -557,5 +557,9 @@ int fm10k_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
 int fm10k_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
 
 /* DCB */
+#ifdef CONFIG_DCB
 void fm10k_dcbnl_set_ops(struct net_device *dev);
+#else
+static inline void fm10k_dcbnl_set_ops(struct net_device *dev) {}
+#endif
 #endif /* _FM10K_H_ */
index 5c7a4d7..2be4361 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "fm10k.h"
 
-#ifdef CONFIG_DCB
 /**
  * fm10k_dcbnl_ieee_getets - get the ETS configuration for the device
  * @dev: netdev interface for the device
@@ -155,7 +154,6 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = {
        .setdcbx        = fm10k_dcbnl_setdcbx,
 };
 
-#endif /* CONFIG_DCB */
 /**
  * fm10k_dcbnl_set_ops - Configures dcbnl ops pointer for netdev
  * @dev: netdev interface for the device
@@ -164,11 +162,9 @@ static const struct dcbnl_rtnl_ops fm10k_dcbnl_ops = {
  **/
 void fm10k_dcbnl_set_ops(struct net_device *dev)
 {
-#ifdef CONFIG_DCB
        struct fm10k_intfc *interface = netdev_priv(dev);
        struct fm10k_hw *hw = &interface->hw;
 
        if (hw->mac.type == fm10k_mac_pf)
                dev->dcbnl_ops = &fm10k_dcbnl_ops;
-#endif /* CONFIG_DCB */
 }
index 5304bc1..5d6137f 100644 (file)
@@ -18,8 +18,6 @@
  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  */
 
-#ifdef CONFIG_DEBUG_FS
-
 #include "fm10k.h"
 
 #include <linux/debugfs.h>
@@ -258,5 +256,3 @@ void fm10k_dbg_exit(void)
        debugfs_remove_recursive(dbg_root);
        dbg_root = NULL;
 }
-
-#endif /* CONFIG_DEBUG_FS */