Commit 0805a0c0 authored by Dmitriy Cherkasov's avatar Dmitriy Cherkasov Committed by Greg Kroah-Hartman

staging: lustre: lnet: remove dead code and useless wrapper

After removing commented out code, ksocknal_csum() becomes a useless
wrapper for crc32_le(). Remove it, and instead call crc32_le() directly.

Fixes the following checkpatch warning:

WARNING: space prohibited before semicolon
Signed-off-by: default avatarDmitriy Cherkasov <dmitriy@oss-tech.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cbe5843e
...@@ -519,17 +519,6 @@ extern struct ksock_proto ksocknal_protocol_v3x; ...@@ -519,17 +519,6 @@ extern struct ksock_proto ksocknal_protocol_v3x;
#define CPU_MASK_NONE 0UL #define CPU_MASK_NONE 0UL
#endif #endif
static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
{
#if 1
return crc32_le(crc, p, len);
#else
while (len-- > 0)
crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ;
return crc;
#endif
}
static inline int static inline int
ksocknal_route_mask(void) ksocknal_route_mask(void)
{ {
......
...@@ -201,9 +201,9 @@ ksocknal_lib_recv_iov(struct ksock_conn *conn) ...@@ -201,9 +201,9 @@ ksocknal_lib_recv_iov(struct ksock_conn *conn)
if (fragnob > sum) if (fragnob > sum)
fragnob = sum; fragnob = sum;
conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum,
iov[i].iov_base, iov[i].iov_base,
fragnob); fragnob);
} }
conn->ksnc_msg.ksm_csum = saved_csum; conn->ksnc_msg.ksm_csum = saved_csum;
} }
...@@ -243,8 +243,8 @@ ksocknal_lib_recv_kiov(struct ksock_conn *conn) ...@@ -243,8 +243,8 @@ ksocknal_lib_recv_kiov(struct ksock_conn *conn)
if (fragnob > sum) if (fragnob > sum)
fragnob = sum; fragnob = sum;
conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum,
base, fragnob); base, fragnob);
kunmap(kiov[i].bv_page); kunmap(kiov[i].bv_page);
} }
...@@ -265,22 +265,22 @@ ksocknal_lib_csum_tx(struct ksock_tx *tx) ...@@ -265,22 +265,22 @@ ksocknal_lib_csum_tx(struct ksock_tx *tx)
tx->tx_msg.ksm_csum = 0; tx->tx_msg.ksm_csum = 0;
csum = ksocknal_csum(~0, tx->tx_iov[0].iov_base, csum = crc32_le(~0, tx->tx_iov[0].iov_base,
tx->tx_iov[0].iov_len); tx->tx_iov[0].iov_len);
if (tx->tx_kiov) { if (tx->tx_kiov) {
for (i = 0; i < tx->tx_nkiov; i++) { for (i = 0; i < tx->tx_nkiov; i++) {
base = kmap(tx->tx_kiov[i].bv_page) + base = kmap(tx->tx_kiov[i].bv_page) +
tx->tx_kiov[i].bv_offset; tx->tx_kiov[i].bv_offset;
csum = ksocknal_csum(csum, base, tx->tx_kiov[i].bv_len); csum = crc32_le(csum, base, tx->tx_kiov[i].bv_len);
kunmap(tx->tx_kiov[i].bv_page); kunmap(tx->tx_kiov[i].bv_page);
} }
} else { } else {
for (i = 1; i < tx->tx_niov; i++) for (i = 1; i < tx->tx_niov; i++)
csum = ksocknal_csum(csum, tx->tx_iov[i].iov_base, csum = crc32_le(csum, tx->tx_iov[i].iov_base,
tx->tx_iov[i].iov_len); tx->tx_iov[i].iov_len);
} }
if (*ksocknal_tunables.ksnd_inject_csum_error) { if (*ksocknal_tunables.ksnd_inject_csum_error) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment