]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ntfs: fix inconsistent indenting warnings
authorHyunchul Lee <hyc.lee@gmail.com>
Fri, 13 Mar 2026 00:25:21 +0000 (09:25 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 16 Mar 2026 11:27:49 +0000 (20:27 +0900)
Detected by Smatch.

ndex.c:2041 ntfs_index_walk_up() warn:
  inconsistent indenting

mft.c:2462 ntfs_mft_record_alloc() warn:
  inconsistent indenting

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/index.c
fs/ntfs/mft.c

index 42251bdb6f5ae5d54a0ba65b3f5c40827231c38b..2080f396913785b31f334dddfc039be395dffb75 100644 (file)
@@ -2007,43 +2007,43 @@ struct index_entry *ntfs_index_walk_down(struct index_entry *ie, struct ntfs_ind
 static struct index_entry *ntfs_index_walk_up(struct index_entry *ie,
                struct ntfs_index_context *ictx)
 {
-       struct index_entry *entry;
+       struct index_entry *entry = ie;
        s64 vcn;
 
-       entry = ie;
-       if (ictx->pindex > 0) {
-               do {
-                       ictx->pindex--;
-                       if (!ictx->pindex) {
-                               /* we have reached the root */
-                               kfree(ictx->ib);
-                               ictx->ib = NULL;
-                               ictx->is_in_root = true;
-                               /* a new search context is to be allocated */
-                               if (ictx->actx)
-                                       ntfs_attr_put_search_ctx(ictx->actx);
-                               ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name,
-                                               ictx->name_len, &ictx->actx);
-                               if (ictx->ir)
-                                       entry = ntfs_ie_get_by_pos(&ictx->ir->index,
-                                                       ictx->parent_pos[ictx->pindex]);
-                               else
-                                       entry = NULL;
-                       } else {
-                                       /* up into non-root node */
-                               vcn = ictx->parent_vcn[ictx->pindex];
-                               if (!ntfs_ib_read(ictx, vcn, ictx->ib)) {
-                                       entry = ntfs_ie_get_by_pos(&ictx->ib->index,
-                                                       ictx->parent_pos[ictx->pindex]);
-                               } else
-                                       entry = NULL;
-                       }
-               ictx->entry = entry;
-               } while (entry && (ictx->pindex > 0) &&
-                               (entry->flags & INDEX_ENTRY_END));
-       } else
-               entry = NULL;
+       if (ictx->pindex <= 0)
+               return NULL;
 
+       do {
+               ictx->pindex--;
+               if (!ictx->pindex) {
+                       /* we have reached the root */
+                       kfree(ictx->ib);
+                       ictx->ib = NULL;
+                       ictx->is_in_root = true;
+                       /* a new search context is to be allocated */
+                       if (ictx->actx)
+                               ntfs_attr_put_search_ctx(ictx->actx);
+                       ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name,
+                                                 ictx->name_len, &ictx->actx);
+                       if (ictx->ir)
+                               entry = ntfs_ie_get_by_pos(
+                                       &ictx->ir->index,
+                                       ictx->parent_pos[ictx->pindex]);
+                       else
+                               entry = NULL;
+               } else {
+                       /* up into non-root node */
+                       vcn = ictx->parent_vcn[ictx->pindex];
+                       if (!ntfs_ib_read(ictx, vcn, ictx->ib)) {
+                               entry = ntfs_ie_get_by_pos(
+                                       &ictx->ib->index,
+                                       ictx->parent_pos[ictx->pindex]);
+                       } else
+                               entry = NULL;
+               }
+               ictx->entry = entry;
+       } while (entry && (ictx->pindex > 0) &&
+                (entry->flags & INDEX_ENTRY_END));
        return entry;
 }
 
index 48e64eaa7ec33f734ed1bd5a89590a1d75140176..8de0a1e47c2e67c673120b71710c1a426edd86cb 100644 (file)
@@ -2459,7 +2459,7 @@ mft_rec_already_initialized:
                        m->flags &= cpu_to_le16(
                                        ~le16_to_cpu(MFT_RECORD_IN_USE));
                        /* Make sure the mft record is written out to disk. */
-                          ntfs_mft_mark_dirty(folio);
+                       ntfs_mft_mark_dirty(folio);
                        folio_unlock(folio);
                        kunmap_local(m);
                        folio_put(folio);