Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'cxgb4-fix-build-error'

Rahul Lakkireddy says:

====================
cxgb4: fix build error

Patch 1 fixes build error with compiling cudbg_zlib.c when
CONFIG_ZLIB_DEFLATE macro is not defined.

Patch 2 fixes following sparse warning:
"Using plain integer as NULL pointer"
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+6 -17
+1
drivers/net/ethernet/chelsio/Kconfig
··· 69 69 depends on PCI && (IPV6 || IPV6=n) 70 70 select FW_LOADER 71 71 select MDIO 72 + select ZLIB_DEFLATE 72 73 ---help--- 73 74 This driver supports Chelsio T4, T5 & T6 based gigabit, 10Gb Ethernet 74 75 adapter and T5/T6 based 40Gb and T6 based 25Gb, 50Gb and 100Gb
+1 -2
drivers/net/ethernet/chelsio/cxgb4/Makefile
··· 8 8 cxgb4-objs := cxgb4_main.o l2t.o smt.o t4_hw.o sge.o clip_tbl.o cxgb4_ethtool.o \ 9 9 cxgb4_uld.o sched.o cxgb4_filter.o cxgb4_tc_u32.o \ 10 10 cxgb4_ptp.o cxgb4_tc_flower.o cxgb4_cudbg.o \ 11 - cudbg_common.o cudbg_lib.o 11 + cudbg_common.o cudbg_lib.o cudbg_zlib.o 12 12 cxgb4-$(CONFIG_CHELSIO_T4_DCB) += cxgb4_dcb.o 13 13 cxgb4-$(CONFIG_CHELSIO_T4_FCOE) += cxgb4_fcoe.o 14 14 cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o 15 - cxgb4-$(CONFIG_ZLIB_DEFLATE) += cudbg_zlib.o
+2 -1
drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.c
··· 40 40 struct cudbg_buffer *pin_buff, 41 41 struct cudbg_buffer *pout_buff) 42 42 { 43 - struct z_stream_s compress_stream = { 0 }; 44 43 struct cudbg_buffer temp_buff = { 0 }; 44 + struct z_stream_s compress_stream; 45 45 struct cudbg_compress_hdr *c_hdr; 46 46 int rc; 47 47 ··· 53 53 c_hdr = (struct cudbg_compress_hdr *)temp_buff.data; 54 54 c_hdr->compress_id = CUDBG_ZLIB_COMPRESS_ID; 55 55 56 + memset(&compress_stream, 0, sizeof(struct z_stream_s)); 56 57 compress_stream.workspace = pdbg_init->workspace; 57 58 rc = zlib_deflateInit2(&compress_stream, Z_DEFAULT_COMPRESSION, 58 59 Z_DEFLATED, CUDBG_ZLIB_WIN_BITS,
-13
drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h
··· 33 33 34 34 static inline int cudbg_get_workspace_size(void) 35 35 { 36 - #ifdef CONFIG_ZLIB_DEFLATE 37 36 return zlib_deflate_workspacesize(CUDBG_ZLIB_WIN_BITS, 38 37 CUDBG_ZLIB_MEM_LVL); 39 - #else 40 - return 0; 41 - #endif /* CONFIG_ZLIB_DEFLATE */ 42 38 } 43 39 44 - #ifndef CONFIG_ZLIB_DEFLATE 45 - static inline int cudbg_compress_buff(struct cudbg_init *pdbg_init, 46 - struct cudbg_buffer *pin_buff, 47 - struct cudbg_buffer *pout_buff) 48 - { 49 - return 0; 50 - } 51 - #else 52 40 int cudbg_compress_buff(struct cudbg_init *pdbg_init, 53 41 struct cudbg_buffer *pin_buff, 54 42 struct cudbg_buffer *pout_buff); 55 - #endif /* CONFIG_ZLIB_DEFLATE */ 56 43 #endif /* __CUDBG_ZLIB_H__ */
+2 -1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
··· 406 406 int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size, 407 407 u32 flag) 408 408 { 409 - struct cudbg_init cudbg_init = { 0 }; 410 409 struct cudbg_buffer dbg_buff = { 0 }; 411 410 u32 size, min_size, total_size = 0; 411 + struct cudbg_init cudbg_init; 412 412 struct cudbg_hdr *cudbg_hdr; 413 413 int rc; 414 414 415 415 size = *buf_size; 416 416 417 + memset(&cudbg_init, 0, sizeof(struct cudbg_init)); 417 418 cudbg_init.adap = adap; 418 419 cudbg_init.outbuf = buf; 419 420 cudbg_init.outbuf_size = size;