diff mbox series

[net-next,1/2] cxgb4: enable ZLIB_DEFLATE when building cxgb4

Message ID a36a37a984a6a7b2d4c634e526852cad885b0887.1516778909.git.rahul.lakkireddy@chelsio.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series cxgb4: fix build error | expand

Commit Message

Rahul Lakkireddy Jan. 24, 2018, 8:01 a.m. UTC
Fixes:
drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.c:39:5: error:
redefinition of 'cudbg_compress_buff'
    int cudbg_compress_buff(struct cudbg_init *pdbg_init,
        ^~~~~~~~~~~~~~~~~~~
   In file included from
drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.c:23:0:
   drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h:45:19: note: previous
definition of 'cudbg_compress_buff' was here
    static inline int cudbg_compress_buff(struct cudbg_init *pdbg_init,
                      ^~~~~~~~~~~~~~~~~~~

Fixes: 91c1953de387 ("cxgb4: use zlib deflate to compress firmware dump")
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
 drivers/net/ethernet/chelsio/Kconfig            |  1 +
 drivers/net/ethernet/chelsio/cxgb4/Makefile     |  3 +--
 drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h | 13 -------------
 3 files changed, 2 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/chelsio/Kconfig b/drivers/net/ethernet/chelsio/Kconfig
index 5713e83be08c..e2cdfa75673f 100644
--- a/drivers/net/ethernet/chelsio/Kconfig
+++ b/drivers/net/ethernet/chelsio/Kconfig
@@ -69,6 +69,7 @@  config CHELSIO_T4
 	depends on PCI && (IPV6 || IPV6=n)
 	select FW_LOADER
 	select MDIO
+	select ZLIB_DEFLATE
 	---help---
 	  This driver supports Chelsio T4, T5 & T6 based gigabit, 10Gb Ethernet
 	  adapter and T5/T6 based 40Gb and T6 based 25Gb, 50Gb and 100Gb
diff --git a/drivers/net/ethernet/chelsio/cxgb4/Makefile b/drivers/net/ethernet/chelsio/cxgb4/Makefile
index 5df923798669..53b6a02c778e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/Makefile
+++ b/drivers/net/ethernet/chelsio/cxgb4/Makefile
@@ -8,8 +8,7 @@  obj-$(CONFIG_CHELSIO_T4) += cxgb4.o
 cxgb4-objs := cxgb4_main.o l2t.o smt.o t4_hw.o sge.o clip_tbl.o cxgb4_ethtool.o \
 	      cxgb4_uld.o sched.o cxgb4_filter.o cxgb4_tc_u32.o \
 	      cxgb4_ptp.o cxgb4_tc_flower.o cxgb4_cudbg.o \
-	      cudbg_common.o cudbg_lib.o
+	      cudbg_common.o cudbg_lib.o cudbg_zlib.o
 cxgb4-$(CONFIG_CHELSIO_T4_DCB) +=  cxgb4_dcb.o
 cxgb4-$(CONFIG_CHELSIO_T4_FCOE) +=  cxgb4_fcoe.o
 cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o
-cxgb4-$(CONFIG_ZLIB_DEFLATE) += cudbg_zlib.o
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h b/drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h
index 9d55c4c38c84..60d23805dfc3 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h
@@ -33,24 +33,11 @@  struct cudbg_compress_hdr {
 
 static inline int cudbg_get_workspace_size(void)
 {
-#ifdef CONFIG_ZLIB_DEFLATE
 	return zlib_deflate_workspacesize(CUDBG_ZLIB_WIN_BITS,
 					  CUDBG_ZLIB_MEM_LVL);
-#else
-	return 0;
-#endif /* CONFIG_ZLIB_DEFLATE */
 }
 
-#ifndef CONFIG_ZLIB_DEFLATE
-static inline int cudbg_compress_buff(struct cudbg_init *pdbg_init,
-				      struct cudbg_buffer *pin_buff,
-				      struct cudbg_buffer *pout_buff)
-{
-	return 0;
-}
-#else
 int cudbg_compress_buff(struct cudbg_init *pdbg_init,
 			struct cudbg_buffer *pin_buff,
 			struct cudbg_buffer *pout_buff);
-#endif /* CONFIG_ZLIB_DEFLATE */
 #endif /* __CUDBG_ZLIB_H__ */