Commit 8d555c52 authored by YueHaibing's avatar YueHaibing Committed by Herbert Xu

crypto: chtls - remove set but not used variables 'err, adap, request, hws'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/crypto/chelsio/chtls/chtls_io.c: In function 'csk_wait_memory':
drivers/crypto/chelsio/chtls/chtls_io.c:925:6: warning:
 variable 'sndbuf' set but not used [-Wunused-but-set-variable]

drivers/crypto/chelsio/chtls/chtls_io.c: In function 'chtls_pt_recvmsg':
drivers/crypto/chelsio/chtls/chtls_io.c:1411:6: warning:
 variable 'request' set but not used [-Wunused-but-set-variable]

drivers/crypto/chelsio/chtls/chtls_io.c:1407:18: warning:
 variable 'adap' set but not used [-Wunused-but-set-variable]

drivers/crypto/chelsio/chtls/chtls_io.c: In function 'chtls_recvmsg':
drivers/crypto/chelsio/chtls/chtls_io.c:1701:6: warning:
 variable 'request' set but not used [-Wunused-but-set-variable]

drivers/crypto/chelsio/chtls/chtls_io.c:1697:20: warning:
 variable 'hws' set but not used [-Wunused-but-set-variable]
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent bec9ba7f
...@@ -922,14 +922,13 @@ static int csk_wait_memory(struct chtls_dev *cdev, ...@@ -922,14 +922,13 @@ static int csk_wait_memory(struct chtls_dev *cdev,
struct sock *sk, long *timeo_p) struct sock *sk, long *timeo_p)
{ {
DEFINE_WAIT_FUNC(wait, woken_wake_function); DEFINE_WAIT_FUNC(wait, woken_wake_function);
int sndbuf, err = 0; int err = 0;
long current_timeo; long current_timeo;
long vm_wait = 0; long vm_wait = 0;
bool noblock; bool noblock;
current_timeo = *timeo_p; current_timeo = *timeo_p;
noblock = (*timeo_p ? false : true); noblock = (*timeo_p ? false : true);
sndbuf = cdev->max_host_sndbuf;
if (csk_mem_free(cdev, sk)) { if (csk_mem_free(cdev, sk)) {
current_timeo = (prandom_u32() % (HZ / 5)) + 2; current_timeo = (prandom_u32() % (HZ / 5)) + 2;
vm_wait = (prandom_u32() % (HZ / 5)) + 2; vm_wait = (prandom_u32() % (HZ / 5)) + 2;
...@@ -1401,23 +1400,18 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, ...@@ -1401,23 +1400,18 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
int nonblock, int flags, int *addr_len) int nonblock, int flags, int *addr_len)
{ {
struct chtls_sock *csk = rcu_dereference_sk_user_data(sk); struct chtls_sock *csk = rcu_dereference_sk_user_data(sk);
struct net_device *dev = csk->egress_dev;
struct chtls_hws *hws = &csk->tlshws; struct chtls_hws *hws = &csk->tlshws;
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct adapter *adap;
unsigned long avail; unsigned long avail;
int buffers_freed; int buffers_freed;
int copied = 0; int copied = 0;
int request;
int target; int target;
long timeo; long timeo;
adap = netdev2adap(dev);
buffers_freed = 0; buffers_freed = 0;
timeo = sock_rcvtimeo(sk, nonblock); timeo = sock_rcvtimeo(sk, nonblock);
target = sock_rcvlowat(sk, flags & MSG_WAITALL, len); target = sock_rcvlowat(sk, flags & MSG_WAITALL, len);
request = len;
if (unlikely(csk_flag(sk, CSK_UPDATE_RCV_WND))) if (unlikely(csk_flag(sk, CSK_UPDATE_RCV_WND)))
chtls_cleanup_rbuf(sk, copied); chtls_cleanup_rbuf(sk, copied);
...@@ -1694,11 +1688,9 @@ int chtls_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, ...@@ -1694,11 +1688,9 @@ int chtls_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
{ {
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
struct chtls_sock *csk; struct chtls_sock *csk;
struct chtls_hws *hws;
unsigned long avail; /* amount of available data in current skb */ unsigned long avail; /* amount of available data in current skb */
int buffers_freed; int buffers_freed;
int copied = 0; int copied = 0;
int request;
long timeo; long timeo;
int target; /* Read at least this many bytes */ int target; /* Read at least this many bytes */
...@@ -1718,7 +1710,6 @@ int chtls_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, ...@@ -1718,7 +1710,6 @@ int chtls_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
lock_sock(sk); lock_sock(sk);
csk = rcu_dereference_sk_user_data(sk); csk = rcu_dereference_sk_user_data(sk);
hws = &csk->tlshws;
if (is_tls_rx(csk)) if (is_tls_rx(csk))
return chtls_pt_recvmsg(sk, msg, len, nonblock, return chtls_pt_recvmsg(sk, msg, len, nonblock,
...@@ -1726,7 +1717,6 @@ int chtls_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, ...@@ -1726,7 +1717,6 @@ int chtls_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
timeo = sock_rcvtimeo(sk, nonblock); timeo = sock_rcvtimeo(sk, nonblock);
target = sock_rcvlowat(sk, flags & MSG_WAITALL, len); target = sock_rcvlowat(sk, flags & MSG_WAITALL, len);
request = len;
if (unlikely(csk_flag(sk, CSK_UPDATE_RCV_WND))) if (unlikely(csk_flag(sk, CSK_UPDATE_RCV_WND)))
chtls_cleanup_rbuf(sk, copied); chtls_cleanup_rbuf(sk, copied);
......
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