Development discussion of WireGuard
 help / color / mirror / Atom feed
* [PATCH] Do not assign in if condition wg_noise_handshake_consume_initiation()
@ 2020-06-09 15:21 Frank Werner-Krippendorf
  2020-06-10  3:42 ` Jason A. Donenfeld
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Werner-Krippendorf @ 2020-06-09 15:21 UTC (permalink / raw)
  To: Jason A. Donenfeld, David S. Miller, Jakub Kicinski, wireguard,
	netdev, linux-kernel
  Cc: Frank Werner-Krippendorf

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>
---
 drivers/net/wireguard/noise.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireguard/noise.c b/drivers/net/wireguard/noise.c
index 626433690abb..9524a15a62a6 100644
--- a/drivers/net/wireguard/noise.c
+++ b/drivers/net/wireguard/noise.c
@@ -617,8 +617,9 @@ 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;
+	initiation_consumption = ktime_get_coarse_boottime_ns();
 	if ((s64)(handshake->last_initiation_consumption -
-	    (initiation_consumption = ktime_get_coarse_boottime_ns())) < 0)
+	    initiation_consumption) < 0)
 		handshake->last_initiation_consumption = initiation_consumption;
 	handshake->state = HANDSHAKE_CONSUMED_INITIATION;
 	up_write(&handshake->lock);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-17  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09 15:21 [PATCH] Do not assign in if condition wg_noise_handshake_consume_initiation() Frank Werner-Krippendorf
2020-06-10  3:42 ` Jason A. Donenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).