s3/libsmb: clang: Fix 'Value stored during initialization is never read'
authorNoel Power <noel.power@suse.com>
Fri, 9 Aug 2019 15:06:20 +0000 (16:06 +0100)
committerGary Lockyer <gary@samba.org>
Wed, 28 Aug 2019 03:06:42 +0000 (03:06 +0000)
Fixes:

source3/libsmb/cliquota.c:340:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
source3/libsmb/cliquota.c:357:4: warning: Value stored to 'status' is never read <--[clang]
                        status = NT_STATUS_OK;
                        ^        ~~~~~~~~~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed Aug 28 03:06:42 UTC 2019 on sn-devel-184

source3/libsmb/cliquota.c

index 06290afb3ecff70bae869fd3e4d58a181b934a3c..45cd32800459df7b901d4b66fe56fa79c008c82f 100644 (file)
@@ -353,9 +353,7 @@ cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST *qtl)
                 * smb1 doesn't send NT_STATUS_NO_MORE_ENTRIES so swallow
                 * this status.
                 */
-               if (NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES)) {
-                       status = NT_STATUS_OK;
-               } else {
+               if (!NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES)) {
                        goto cleanup;
                }
        }