Skip to contentSkip to conversation

staging: lustre: socklnd: sparse warning fix

PATCH In review Igor Bogomazov 2 participants 2 messages Nov 16, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: socklnd: sparse warning fix

sparse reports the following issue:
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c:393:9:
error: incompatible types in comparison expression (different address spaces)

Cc Oleg Drokin <[email protected]>
Cc Andreas Dilger <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

---
applies to linux-next

the same value casted the same way few lines below:

	csum = ksocknal_csum(~0, (void *)tx->tx_iov[0].iov_base,

then it seems like a typo in LASSERT() that is got fixed

 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c +1 -1
index 245c9d7..ebd400d 100644
@@ -390,7 +390,7 @@ ksocknal_lib_csum_tx(ksock_tx_t *tx)
 	__u32	csum;
 	void	*base;
 
-	LASSERT(tx->tx_iov[0].iov_base == (void *)&tx->tx_msg);
+	LASSERT((void *)tx->tx_iov[0].iov_base == &tx->tx_msg);
 	LASSERT(tx->tx_conn != NULL);
 	LASSERT(tx->tx_conn->ksnc_proto == &ksocknal_protocol_v2x);
 
#1 lore raw
Quoted 13 lines

the same value casted the same way few lines below:

	csum = ksocknal_csum(~0, (void *)tx->tx_iov[0].iov_base,

then it seems like a typo in LASSERT() that is got fixed

 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c +0 -0
index 245c9d7..ebd400d 100644

drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c ksocknal_lib_csum_tx(ksock_tx_t *tx) · line 393

Quoted 5 lines
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c +1 -1
@@ -390,7 +390,7 @@ ksocknal_lib_csum_tx(ksock_tx_t *tx)
 	__u32	csum;
 	void	*base;
 
-	LASSERT(tx->tx_iov[0].iov_base == (void *)&tx->tx_msg);
+	LASSERT((void *)tx->tx_iov[0].iov_base == &tx->tx_msg);

Turn tx_iov into struct kvec * instead.