Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ntfs: fix inconsistent indenting warnings

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>

authored by

Hyunchul Lee and committed by
Namjae Jeon
068a35fd 4e59f8a1

+35 -35
+34 -34
fs/ntfs/index.c
··· 2007 2007 static struct index_entry *ntfs_index_walk_up(struct index_entry *ie, 2008 2008 struct ntfs_index_context *ictx) 2009 2009 { 2010 - struct index_entry *entry; 2010 + struct index_entry *entry = ie; 2011 2011 s64 vcn; 2012 2012 2013 - entry = ie; 2014 - if (ictx->pindex > 0) { 2015 - do { 2016 - ictx->pindex--; 2017 - if (!ictx->pindex) { 2018 - /* we have reached the root */ 2019 - kfree(ictx->ib); 2020 - ictx->ib = NULL; 2021 - ictx->is_in_root = true; 2022 - /* a new search context is to be allocated */ 2023 - if (ictx->actx) 2024 - ntfs_attr_put_search_ctx(ictx->actx); 2025 - ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name, 2026 - ictx->name_len, &ictx->actx); 2027 - if (ictx->ir) 2028 - entry = ntfs_ie_get_by_pos(&ictx->ir->index, 2029 - ictx->parent_pos[ictx->pindex]); 2030 - else 2031 - entry = NULL; 2032 - } else { 2033 - /* up into non-root node */ 2034 - vcn = ictx->parent_vcn[ictx->pindex]; 2035 - if (!ntfs_ib_read(ictx, vcn, ictx->ib)) { 2036 - entry = ntfs_ie_get_by_pos(&ictx->ib->index, 2037 - ictx->parent_pos[ictx->pindex]); 2038 - } else 2039 - entry = NULL; 2040 - } 2041 - ictx->entry = entry; 2042 - } while (entry && (ictx->pindex > 0) && 2043 - (entry->flags & INDEX_ENTRY_END)); 2044 - } else 2045 - entry = NULL; 2013 + if (ictx->pindex <= 0) 2014 + return NULL; 2046 2015 2016 + do { 2017 + ictx->pindex--; 2018 + if (!ictx->pindex) { 2019 + /* we have reached the root */ 2020 + kfree(ictx->ib); 2021 + ictx->ib = NULL; 2022 + ictx->is_in_root = true; 2023 + /* a new search context is to be allocated */ 2024 + if (ictx->actx) 2025 + ntfs_attr_put_search_ctx(ictx->actx); 2026 + ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name, 2027 + ictx->name_len, &ictx->actx); 2028 + if (ictx->ir) 2029 + entry = ntfs_ie_get_by_pos( 2030 + &ictx->ir->index, 2031 + ictx->parent_pos[ictx->pindex]); 2032 + else 2033 + entry = NULL; 2034 + } else { 2035 + /* up into non-root node */ 2036 + vcn = ictx->parent_vcn[ictx->pindex]; 2037 + if (!ntfs_ib_read(ictx, vcn, ictx->ib)) { 2038 + entry = ntfs_ie_get_by_pos( 2039 + &ictx->ib->index, 2040 + ictx->parent_pos[ictx->pindex]); 2041 + } else 2042 + entry = NULL; 2043 + } 2044 + ictx->entry = entry; 2045 + } while (entry && (ictx->pindex > 0) && 2046 + (entry->flags & INDEX_ENTRY_END)); 2047 2047 return entry; 2048 2048 } 2049 2049
+1 -1
fs/ntfs/mft.c
··· 2459 2459 m->flags &= cpu_to_le16( 2460 2460 ~le16_to_cpu(MFT_RECORD_IN_USE)); 2461 2461 /* Make sure the mft record is written out to disk. */ 2462 - ntfs_mft_mark_dirty(folio); 2462 + ntfs_mft_mark_dirty(folio); 2463 2463 folio_unlock(folio); 2464 2464 kunmap_local(m); 2465 2465 folio_put(folio);