]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Slightly simplify server_id_set_disconnected()
authorVolker Lendecke <vl@samba.org>
Thu, 17 Dec 2020 10:37:47 +0000 (11:37 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 4 Jun 2021 17:34:06 +0000 (17:34 +0000)
The NULL assert is not really required, it will crash nicely if that's
not fulfilled.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun  4 17:34:06 UTC 2021 on sn-devel-184

lib/util/server_id.c

index e66c9791007a97bef1726c80770b39658d1da341..690b9ddfbdca49e539a9999ff565303d65ff2da7 100644 (file)
@@ -187,14 +187,12 @@ struct server_id server_id_from_string(uint32_t local_vnn,
  */
 void server_id_set_disconnected(struct server_id *id)
 {
-       SMB_ASSERT(id != NULL);
-
-       id->pid = UINT64_MAX;
-       id->task_id = UINT32_MAX;
-       id->vnn = NONCLUSTER_VNN;
-       id->unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY;
-
-       return;
+       *id = (struct server_id) {
+               .pid = UINT64_MAX,
+               .task_id = UINT32_MAX,
+               .vnn = NONCLUSTER_VNN,
+               .unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY,
+       };
 }
 
 /**