]> www.infradead.org Git - users/hch/uuid.git/commitdiff
wireguard: noise: do not assign initiation time in if condition
authorFrank Werner-Krippendorf <mail@hb9fxq.ch>
Tue, 23 Jun 2020 09:59:44 +0000 (03:59 -0600)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Jun 2020 21:50:34 +0000 (14:50 -0700)
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>
drivers/net/wireguard/noise.c

index 626433690abb396deb80315856648bd1adda7276..201a22681945fa845d8b22d802d454ca7000d405 100644 (file)
@@ -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);