Commit a83024b9 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'cxgb4-cxgb4vf-fix-warnings-reported-by-sparse'



Rahul Lakkireddy says:

====================
cxgb4/cxgb4vf: fix warnings reported by sparse

This series of patches fix various warnings reported by the sparse
tool.

Patches 1 and 2 fix lock context imbalance warnings.

Patch 3 fixes cast to restricted __be64 warning when fetching
timestamp in PTP path.

Patch 4 fixes several cast to restricted __be32 warnings in TC-U32
offload parser.

Patch 5 fixes several cast from restricted __be16 warnings in parsing
L4 ports for filters.

Patch 6 fixes several restricted __be32 degrades to integer warnings
when comparing IP address masks for exact-match filters.

Patch 7 fixes cast to restricted __be64 warning when fetching SGE
queue contexts in device dump collection.

Patch 8 fixes cast from restricted __sum16 warning when saving IPv4
partial checksum.

Patch 9 fixes issue with string array scope in DCB path.

Patch 10 fixes a set but unused variable warning when DCB is disabled.

Patch 11 fixes several kernel-doc comment warnings in cxgb4 driver.

Patch 12 fixes several kernel-doc comment warnings in cxgb4vf driver.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6199496b 20bb0c8f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1975,7 +1975,6 @@ int cudbg_collect_dump_context(struct cudbg_init *pdbg_init,
	u8 mem_type[CTXT_INGRESS + 1] = { 0 };
	struct cudbg_buffer temp_buff = { 0 };
	struct cudbg_ch_cntxt *buff;
	u64 *dst_off, *src_off;
	u8 *ctx_buf;
	u8 i, k;
	int rc;
@@ -2044,8 +2043,11 @@ int cudbg_collect_dump_context(struct cudbg_init *pdbg_init,
		}

		for (j = 0; j < max_ctx_qid; j++) {
			__be64 *dst_off;
			u64 *src_off;

			src_off = (u64 *)(ctx_buf + j * SGE_CTXT_SIZE);
			dst_off = (u64 *)buff->data;
			dst_off = (__be64 *)buff->data;

			/* The data is stored in 64-bit cpu order.  Convert it
			 * to big endian before parsing.
+3 −0
Original line number Diff line number Diff line
@@ -136,6 +136,9 @@ static inline __u8 bitswap_1(unsigned char val)
	       ((val & 0x02) << 5) |
	       ((val & 0x01) << 7);
}

extern const char * const dcb_ver_array[];

#define CXGB4_DCB_ENABLED true

#else /* !CONFIG_CHELSIO_T4_DCB */
+0 −1
Original line number Diff line number Diff line
@@ -2379,7 +2379,6 @@ static const struct file_operations rss_vf_config_debugfs_fops = {
};

#ifdef CONFIG_CHELSIO_T4_DCB
extern char *dcb_ver_array[];

/* Data Center Briging information for each port.
 */
+1 −1
Original line number Diff line number Diff line
@@ -588,7 +588,7 @@ static void fw_caps_to_lmm(enum fw_port_type port_type,
/**
 *	lmm_to_fw_caps - translate ethtool Link Mode Mask to Firmware
 *	capabilities
 *	@et_lmm: ethtool Link Mode Mask
 *	@link_mode_mask: ethtool Link Mode Mask
 *
 *	Translate ethtool Link Mode Mask into a Firmware Port capabilities
 *	value.
+16 −9
Original line number Diff line number Diff line
@@ -165,6 +165,9 @@ static void set_nat_params(struct adapter *adap, struct filter_entry *f,
			   unsigned int tid, bool dip, bool sip, bool dp,
			   bool sp)
{
	u8 *nat_lp = (u8 *)&f->fs.nat_lport;
	u8 *nat_fp = (u8 *)&f->fs.nat_fport;

	if (dip) {
		if (f->fs.type) {
			set_tcb_field(adap, f, tid, TCB_SND_UNA_RAW_W,
@@ -236,8 +239,9 @@ static void set_nat_params(struct adapter *adap, struct filter_entry *f,
	}

	set_tcb_field(adap, f, tid, TCB_PDU_HDR_LEN_W, WORD_MASK,
		      (dp ? f->fs.nat_lport : 0) |
		      (sp ? f->fs.nat_fport << 16 : 0), 1);
		      (dp ? (nat_lp[1] | nat_lp[0] << 8) : 0) |
		      (sp ? (nat_fp[1] << 16 | nat_fp[0] << 24) : 0),
		      1);
}

/* Validate filter spec against configuration done on the card. */
@@ -909,6 +913,9 @@ int set_filter_wr(struct adapter *adapter, int fidx)
	fwr->fpm = htons(f->fs.mask.fport);

	if (adapter->params.filter2_wr_support) {
		u8 *nat_lp = (u8 *)&f->fs.nat_lport;
		u8 *nat_fp = (u8 *)&f->fs.nat_fport;

		fwr->natmode_to_ulp_type =
			FW_FILTER2_WR_ULP_TYPE_V(f->fs.nat_mode ?
						 ULP_MODE_TCPDDP :
@@ -916,8 +923,8 @@ int set_filter_wr(struct adapter *adapter, int fidx)
			FW_FILTER2_WR_NATMODE_V(f->fs.nat_mode);
		memcpy(fwr->newlip, f->fs.nat_lip, sizeof(fwr->newlip));
		memcpy(fwr->newfip, f->fs.nat_fip, sizeof(fwr->newfip));
		fwr->newlport = htons(f->fs.nat_lport);
		fwr->newfport = htons(f->fs.nat_fport);
		fwr->newlport = htons(nat_lp[1] | nat_lp[0] << 8);
		fwr->newfport = htons(nat_fp[1] | nat_fp[0] << 8);
	}

	/* Mark the filter as "pending" and ship off the Filter Work Request.
@@ -1105,16 +1112,16 @@ static bool is_addr_all_mask(u8 *ipmask, int family)
		struct in_addr *addr;

		addr = (struct in_addr *)ipmask;
		if (addr->s_addr == 0xffffffff)
		if (ntohl(addr->s_addr) == 0xffffffff)
			return true;
	} else if (family == AF_INET6) {
		struct in6_addr *addr6;

		addr6 = (struct in6_addr *)ipmask;
		if (addr6->s6_addr32[0] == 0xffffffff &&
		    addr6->s6_addr32[1] == 0xffffffff &&
		    addr6->s6_addr32[2] == 0xffffffff &&
		    addr6->s6_addr32[3] == 0xffffffff)
		if (ntohl(addr6->s6_addr32[0]) == 0xffffffff &&
		    ntohl(addr6->s6_addr32[1]) == 0xffffffff &&
		    ntohl(addr6->s6_addr32[2]) == 0xffffffff &&
		    ntohl(addr6->s6_addr32[3]) == 0xffffffff)
			return true;
	}
	return false;
Loading