Skip to content

Commit 969ade4

Browse files
committed
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 <[email protected]>
2 parents 9e1a27c + 325694e commit 969ade4

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

drivers/net/ethernet/chelsio/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ config CHELSIO_T4
6969
depends on PCI && (IPV6 || IPV6=n)
7070
select FW_LOADER
7171
select MDIO
72+
select ZLIB_DEFLATE
7273
---help---
7374
This driver supports Chelsio T4, T5 & T6 based gigabit, 10Gb Ethernet
7475
adapter and T5/T6 based 40Gb and T6 based 25Gb, 50Gb and 100Gb

drivers/net/ethernet/chelsio/cxgb4/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ obj-$(CONFIG_CHELSIO_T4) += cxgb4.o
88
cxgb4-objs := cxgb4_main.o l2t.o smt.o t4_hw.o sge.o clip_tbl.o cxgb4_ethtool.o \
99
cxgb4_uld.o sched.o cxgb4_filter.o cxgb4_tc_u32.o \
1010
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
1212
cxgb4-$(CONFIG_CHELSIO_T4_DCB) += cxgb4_dcb.o
1313
cxgb4-$(CONFIG_CHELSIO_T4_FCOE) += cxgb4_fcoe.o
1414
cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o
15-
cxgb4-$(CONFIG_ZLIB_DEFLATE) += cudbg_zlib.o

drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ int cudbg_compress_buff(struct cudbg_init *pdbg_init,
4040
struct cudbg_buffer *pin_buff,
4141
struct cudbg_buffer *pout_buff)
4242
{
43-
struct z_stream_s compress_stream = { 0 };
4443
struct cudbg_buffer temp_buff = { 0 };
44+
struct z_stream_s compress_stream;
4545
struct cudbg_compress_hdr *c_hdr;
4646
int rc;
4747

@@ -53,6 +53,7 @@ int cudbg_compress_buff(struct cudbg_init *pdbg_init,
5353
c_hdr = (struct cudbg_compress_hdr *)temp_buff.data;
5454
c_hdr->compress_id = CUDBG_ZLIB_COMPRESS_ID;
5555

56+
memset(&compress_stream, 0, sizeof(struct z_stream_s));
5657
compress_stream.workspace = pdbg_init->workspace;
5758
rc = zlib_deflateInit2(&compress_stream, Z_DEFAULT_COMPRESSION,
5859
Z_DEFLATED, CUDBG_ZLIB_WIN_BITS,

drivers/net/ethernet/chelsio/cxgb4/cudbg_zlib.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,11 @@ struct cudbg_compress_hdr {
3333

3434
static inline int cudbg_get_workspace_size(void)
3535
{
36-
#ifdef CONFIG_ZLIB_DEFLATE
3736
return zlib_deflate_workspacesize(CUDBG_ZLIB_WIN_BITS,
3837
CUDBG_ZLIB_MEM_LVL);
39-
#else
40-
return 0;
41-
#endif /* CONFIG_ZLIB_DEFLATE */
4238
}
4339

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
5240
int cudbg_compress_buff(struct cudbg_init *pdbg_init,
5341
struct cudbg_buffer *pin_buff,
5442
struct cudbg_buffer *pout_buff);
55-
#endif /* CONFIG_ZLIB_DEFLATE */
5643
#endif /* __CUDBG_ZLIB_H__ */

drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,15 @@ static void cudbg_free_compress_buff(struct cudbg_init *pdbg_init)
406406
int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
407407
u32 flag)
408408
{
409-
struct cudbg_init cudbg_init = { 0 };
410409
struct cudbg_buffer dbg_buff = { 0 };
411410
u32 size, min_size, total_size = 0;
411+
struct cudbg_init cudbg_init;
412412
struct cudbg_hdr *cudbg_hdr;
413413
int rc;
414414

415415
size = *buf_size;
416416

417+
memset(&cudbg_init, 0, sizeof(struct cudbg_init));
417418
cudbg_init.adap = adap;
418419
cudbg_init.outbuf = buf;
419420
cudbg_init.outbuf_size = size;

0 commit comments

Comments
 (0)