]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Reduce indentation
authorVolker Lendecke <vl@samba.org>
Mon, 10 Nov 2025 16:03:42 +0000 (17:03 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 7 Jan 2026 09:57:40 +0000 (09:57 +0000)
Avoid a few "else" statements, review with "git show -w".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
lib/util/fsusage.c

index f71a2aed50a1beecbaf7404e17459e8fd982c030..c8dc0b3db9b43982f915538792f0f17e3635da84 100644 (file)
@@ -33,15 +33,20 @@ static uint64_t adjust_blocks(uint64_t blocks, uint64_t fromsize, uint64_t tosiz
 {
        if (fromsize == tosize) { /* e.g., from 512 to 512 */
                return blocks;
-       } else if (fromsize > tosize) { /* e.g., from 2048 to 512 */
+       }
+
+       if (fromsize > tosize) { /* e.g., from 2048 to 512 */
                return blocks * (fromsize / tosize);
-       } else { /* e.g., from 256 to 512 */
-               /* Protect against broken filesystems... */
-               if (fromsize == 0) {
-                       fromsize = tosize;
-               }
-               return (blocks + 1) / (tosize / fromsize);
        }
+
+       /* e.g., from 256 to 512 */
+       /* Protect against broken filesystems... */
+
+       if (fromsize == 0) {
+               fromsize = tosize;
+       }
+
+       return (blocks + 1) / (tosize / fromsize);
 }
 
 /**