Skip to content

Commit

Permalink
net/tls: remove set but not used variables
Browse files Browse the repository at this point in the history
Commit 4504ab0 ("net/tls: Inform user space about send buffer availability")
made us report write_space regardless whether partial record
push was successful or not.  Remove the now unused return value
to clean up the following W=1 warning:

net/tls/tls_device.c: In function ‘tls_device_write_space’:
net/tls/tls_device.c:546:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
  int rc = 0;
      ^~

CC: Vakul Garg <vakul.garg@nxp.com>
CC: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed May 9, 2019
1 parent 15192f2 commit 88c80be
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/tls/tls_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,14 +541,11 @@ static int tls_device_push_pending_record(struct sock *sk, int flags)

void tls_device_write_space(struct sock *sk, struct tls_context *ctx)
{
int rc = 0;

if (!sk->sk_write_pending && tls_is_partially_sent_record(ctx)) {
gfp_t sk_allocation = sk->sk_allocation;

sk->sk_allocation = GFP_ATOMIC;
rc = tls_push_partial_record(sk, ctx,
MSG_DONTWAIT | MSG_NOSIGNAL);
tls_push_partial_record(sk, ctx, MSG_DONTWAIT | MSG_NOSIGNAL);
sk->sk_allocation = sk_allocation;
}
}
Expand Down

0 comments on commit 88c80be

Please sign in to comment.