diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-04 10:44:42 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-04 11:08:29 -0600 |
commit | 6214b358a5502915d977d3f850d34bcad71c4cde (patch) | |
tree | 3f8849570e0ecbb60e9778ab38225705e1f46101 /src/noise.c | |
parent | global: satisfy check_patch.pl errors (diff) | |
download | wireguard-monolithic-historical-6214b358a5502915d977d3f850d34bcad71c4cde.tar.xz wireguard-monolithic-historical-6214b358a5502915d977d3f850d34bcad71c4cde.zip |
global: prefer sizeof(*pointer) when possible
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
Diffstat (limited to 'src/noise.c')
-rw-r--r-- | src/noise.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/noise.c b/src/noise.c index 70b53a6..9bd2d7e 100644 --- a/src/noise.c +++ b/src/noise.c @@ -67,7 +67,7 @@ bool noise_handshake_init(struct noise_handshake *handshake, const u8 peer_preshared_key[NOISE_SYMMETRIC_KEY_LEN], struct wireguard_peer *peer) { - memset(handshake, 0, sizeof(struct noise_handshake)); + memset(handshake, 0, sizeof(*handshake)); init_rwsem(&handshake->lock); handshake->entry.type = INDEX_HASHTABLE_HANDSHAKE; handshake->entry.peer = peer; @@ -103,8 +103,7 @@ void noise_handshake_clear(struct noise_handshake *handshake) static struct noise_keypair *keypair_create(struct wireguard_peer *peer) { - struct noise_keypair *keypair = - kzalloc(sizeof(struct noise_keypair), GFP_KERNEL); + struct noise_keypair *keypair = kzalloc(sizeof(*keypair), GFP_KERNEL); if (unlikely(!keypair)) return NULL; |