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>
This commit is contained in:
commit
969ade4086
|
@ -69,6 +69,7 @@ config CHELSIO_T4
|
||||||
depends on PCI && (IPV6 || IPV6=n)
|
depends on PCI && (IPV6 || IPV6=n)
|
||||||
select FW_LOADER
|
select FW_LOADER
|
||||||
select MDIO
|
select MDIO
|
||||||
|
select ZLIB_DEFLATE
|
||||||
---help---
|
---help---
|
||||||
This driver supports Chelsio T4, T5 & T6 based gigabit, 10Gb Ethernet
|
This driver supports Chelsio T4, T5 & T6 based gigabit, 10Gb Ethernet
|
||||||
adapter and T5/T6 based 40Gb and T6 based 25Gb, 50Gb and 100Gb
|
adapter and T5/T6 based 40Gb and T6 based 25Gb, 50Gb and 100Gb
|
||||||
|
|
|
@ -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-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_uld.o sched.o cxgb4_filter.o cxgb4_tc_u32.o \
|
||||||
cxgb4_ptp.o cxgb4_tc_flower.o cxgb4_cudbg.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_DCB) += cxgb4_dcb.o
|
||||||
cxgb4-$(CONFIG_CHELSIO_T4_FCOE) += cxgb4_fcoe.o
|
cxgb4-$(CONFIG_CHELSIO_T4_FCOE) += cxgb4_fcoe.o
|
||||||
cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o
|
cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o
|
||||||
cxgb4-$(CONFIG_ZLIB_DEFLATE) += cudbg_zlib.o
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ int cudbg_compress_buff(struct cudbg_init *pdbg_init,
|
||||||
struct cudbg_buffer *pin_buff,
|
struct cudbg_buffer *pin_buff,
|
||||||
struct cudbg_buffer *pout_buff)
|
struct cudbg_buffer *pout_buff)
|
||||||
{
|
{
|
||||||
struct z_stream_s compress_stream = { 0 };
|
|
||||||
struct cudbg_buffer temp_buff = { 0 };
|
struct cudbg_buffer temp_buff = { 0 };
|
||||||
|
struct z_stream_s compress_stream;
|
||||||
struct cudbg_compress_hdr *c_hdr;
|
struct cudbg_compress_hdr *c_hdr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ int cudbg_compress_buff(struct cudbg_init *pdbg_init,
|
||||||
c_hdr = (struct cudbg_compress_hdr *)temp_buff.data;
|
c_hdr = (struct cudbg_compress_hdr *)temp_buff.data;
|
||||||
c_hdr->compress_id = CUDBG_ZLIB_COMPRESS_ID;
|
c_hdr->compress_id = CUDBG_ZLIB_COMPRESS_ID;
|
||||||
|
|
||||||
|
memset(&compress_stream, 0, sizeof(struct z_stream_s));
|
||||||
compress_stream.workspace = pdbg_init->workspace;
|
compress_stream.workspace = pdbg_init->workspace;
|
||||||
rc = zlib_deflateInit2(&compress_stream, Z_DEFAULT_COMPRESSION,
|
rc = zlib_deflateInit2(&compress_stream, Z_DEFAULT_COMPRESSION,
|
||||||
Z_DEFLATED, CUDBG_ZLIB_WIN_BITS,
|
Z_DEFLATED, CUDBG_ZLIB_WIN_BITS,
|
||||||
|
|
|
@ -33,24 +33,11 @@ struct cudbg_compress_hdr {
|
||||||
|
|
||||||
static inline int cudbg_get_workspace_size(void)
|
static inline int cudbg_get_workspace_size(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ZLIB_DEFLATE
|
|
||||||
return zlib_deflate_workspacesize(CUDBG_ZLIB_WIN_BITS,
|
return zlib_deflate_workspacesize(CUDBG_ZLIB_WIN_BITS,
|
||||||
CUDBG_ZLIB_MEM_LVL);
|
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,
|
int cudbg_compress_buff(struct cudbg_init *pdbg_init,
|
||||||
struct cudbg_buffer *pin_buff,
|
struct cudbg_buffer *pin_buff,
|
||||||
struct cudbg_buffer *pout_buff);
|
struct cudbg_buffer *pout_buff);
|
||||||
#endif /* CONFIG_ZLIB_DEFLATE */
|
|
||||||
#endif /* __CUDBG_ZLIB_H__ */
|
#endif /* __CUDBG_ZLIB_H__ */
|
||||||
|
|
|
@ -406,14 +406,15 @@ static void cudbg_free_compress_buff(struct cudbg_init *pdbg_init)
|
||||||
int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
|
int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
|
||||||
u32 flag)
|
u32 flag)
|
||||||
{
|
{
|
||||||
struct cudbg_init cudbg_init = { 0 };
|
|
||||||
struct cudbg_buffer dbg_buff = { 0 };
|
struct cudbg_buffer dbg_buff = { 0 };
|
||||||
u32 size, min_size, total_size = 0;
|
u32 size, min_size, total_size = 0;
|
||||||
|
struct cudbg_init cudbg_init;
|
||||||
struct cudbg_hdr *cudbg_hdr;
|
struct cudbg_hdr *cudbg_hdr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
size = *buf_size;
|
size = *buf_size;
|
||||||
|
|
||||||
|
memset(&cudbg_init, 0, sizeof(struct cudbg_init));
|
||||||
cudbg_init.adap = adap;
|
cudbg_init.adap = adap;
|
||||||
cudbg_init.outbuf = buf;
|
cudbg_init.outbuf = buf;
|
||||||
cudbg_init.outbuf_size = size;
|
cudbg_init.outbuf_size = size;
|
||||||
|
|
Loading…
Reference in New Issue