[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200623095945.1402468-2-Jason@zx2c4.com>
Date: Tue, 23 Jun 2020 03:59:44 -0600
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: davem@...emloft.net, netdev@...r.kernel.org
Cc: Frank Werner-Krippendorf <mail@...fxq.ch>,
"Jason A . Donenfeld" <Jason@...c4.com>
Subject: [PATCH net 1/2] wireguard: noise: do not assign initiation time in if condition
From: Frank Werner-Krippendorf <mail@...fxq.ch>
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@...fxq.ch>
Signed-off-by: Jason A. Donenfeld <Jason@...c4.com>
---
drivers/net/wireguard/noise.c | 4 ++--
1 file 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);
--
2.27.0
Powered by blists - more mailing lists