diff options
author | Frank Werner-Krippendorf <mail@hb9fxq.ch> | 2020-06-23 12:59:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-24 00:50:34 +0300 |
commit | 558b353c9c2a717509f291c066c6bd8f5f5e21be (patch) | |
tree | 88d932afc579a9963b27a3593e36f1ac59cb05a2 /drivers/net/wireguard/noise.c | |
parent | f7fb92acd9e5606f6666bb0f9a7240002a6b3ff0 (diff) | |
download | linux-558b353c9c2a717509f291c066c6bd8f5f5e21be.tar.xz |
wireguard: noise: do not assign initiation time in if condition
Fixes an error condition reported by checkpatch.pl which caused by
assigning a variable in an if condition in wg_noise_handshake_consume_
initiation().
Signed-off-by: Frank Werner-Krippendorf <mail@hb9fxq.ch>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireguard/noise.c')
-rw-r--r-- | drivers/net/wireguard/noise.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireguard/noise.c b/drivers/net/wireguard/noise.c index 626433690abb..201a22681945 100644 --- a/drivers/net/wireguard/noise.c +++ b/drivers/net/wireguard/noise.c @@ -617,8 +617,8 @@ wg_noise_handshake_consume_initiation(struct message_handshake_initiation *src, memcpy(handshake->hash, hash, NOISE_HASH_LEN); memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN); handshake->remote_index = src->sender_index; - if ((s64)(handshake->last_initiation_consumption - - (initiation_consumption = ktime_get_coarse_boottime_ns())) < 0) + initiation_consumption = ktime_get_coarse_boottime_ns(); + if ((s64)(handshake->last_initiation_consumption - initiation_consumption) < 0) handshake->last_initiation_consumption = initiation_consumption; handshake->state = HANDSHAKE_CONSUMED_INITIATION; up_write(&handshake->lock); |