From: Mike Snitzer <snitzer@xxxxxxxxxx> Add braces around multi-line while loops and if statements. Also remove excess newlines. Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Chung Chung <cchung@xxxxxxxxxx> Signed-off-by: Matthew Sakai <msakai@xxxxxxxxxx> --- drivers/md/dm-vdo/index-layout.c | 10 +++++----- drivers/md/dm-vdo/index-page-map.c | 3 +-- drivers/md/dm-vdo/index-session.c | 12 ++++++++---- drivers/md/dm-vdo/index.c | 3 +-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/md/dm-vdo/index-layout.c b/drivers/md/dm-vdo/index-layout.c index 6446a1f58641..f0511988ea07 100644 --- a/drivers/md/dm-vdo/index-layout.c +++ b/drivers/md/dm-vdo/index-layout.c @@ -386,9 +386,10 @@ static void define_sub_index_nonce(struct index_layout *layout) encode_u64_le(buffer, &offset, sil->sub_index.start_block); encode_u16_le(buffer, &offset, 0); sil->nonce = generate_secondary_nonce(primary_nonce, buffer, sizeof(buffer)); - if (sil->nonce == 0) + if (sil->nonce == 0) { sil->nonce = generate_secondary_nonce(~primary_nonce + 1, buffer, sizeof(buffer)); + } } static void setup_sub_index(struct index_layout *layout, u64 start_block, @@ -651,10 +652,11 @@ static int discard_index_state_data(struct index_layout *layout) saved_result = result; } - if (saved_result != UDS_SUCCESS) + if (saved_result != UDS_SUCCESS) { return uds_log_error_strerror(result, "%s: cannot destroy all index saves", __func__); + } return UDS_SUCCESS; } @@ -1242,9 +1244,7 @@ static int __must_check read_super_block_data(struct buffered_reader *reader, "unknown superblock magic label"); if ((super->version < SUPER_VERSION_MINIMUM) || - (super->version == 4) || - (super->version == 5) || - (super->version == 6) || + (super->version == 4) || (super->version == 5) || (super->version == 6) || (super->version > SUPER_VERSION_MAXIMUM)) { return uds_log_error_strerror(UDS_UNSUPPORTED_VERSION, "unknown superblock version number %u", diff --git a/drivers/md/dm-vdo/index-page-map.c b/drivers/md/dm-vdo/index-page-map.c index 190d12848ba2..acfff74f37bc 100644 --- a/drivers/md/dm-vdo/index-page-map.c +++ b/drivers/md/dm-vdo/index-page-map.c @@ -100,8 +100,7 @@ void uds_get_list_number_bounds(const struct index_page_map *map, u32 chapter_nu u32 slot = chapter_number * map->entries_per_chapter; *lowest_list = ((index_page_number == 0) ? - 0 : - map->entries[slot + index_page_number - 1] + 1); + 0 : map->entries[slot + index_page_number - 1] + 1); *highest_list = ((index_page_number < map->entries_per_chapter) ? map->entries[slot + index_page_number] : map->geometry->delta_lists_per_chapter - 1); diff --git a/drivers/md/dm-vdo/index-session.c b/drivers/md/dm-vdo/index-session.c index 73c2927f74ce..c261453b9871 100644 --- a/drivers/md/dm-vdo/index-session.c +++ b/drivers/md/dm-vdo/index-session.c @@ -392,9 +392,10 @@ int uds_open_index(enum uds_open_index_type open_type, static void wait_for_no_requests_in_progress(struct uds_index_session *index_session) { uds_lock_mutex(&index_session->request_mutex); - while (index_session->request_count > 0) + while (index_session->request_count > 0) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } uds_unlock_mutex(&index_session->request_mutex); } @@ -619,9 +620,10 @@ int uds_close_index(struct uds_index_session *index_session) /* Wait for any current index state change to complete. */ uds_lock_mutex(&index_session->request_mutex); while ((index_session->state & IS_FLAG_WAITING) || - (index_session->state & IS_FLAG_CLOSING)) + (index_session->state & IS_FLAG_CLOSING)) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } if (index_session->state & IS_FLAG_SUSPENDED) { uds_log_info("Index session is suspended"); @@ -660,9 +662,10 @@ int uds_destroy_index_session(struct uds_index_session *index_session) /* Wait for any current index state change to complete. */ uds_lock_mutex(&index_session->request_mutex); while ((index_session->state & IS_FLAG_WAITING) || - (index_session->state & IS_FLAG_CLOSING)) + (index_session->state & IS_FLAG_CLOSING)) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } if (index_session->state & IS_FLAG_DESTROYING) { uds_unlock_mutex(&index_session->request_mutex); @@ -686,9 +689,10 @@ int uds_destroy_index_session(struct uds_index_session *index_session) /* Wait until the load exits before proceeding. */ uds_lock_mutex(&index_session->request_mutex); - while (index_session->state & IS_FLAG_LOADING) + while (index_session->state & IS_FLAG_LOADING) { uds_wait_cond(&index_session->request_cond, &index_session->request_mutex); + } uds_unlock_mutex(&index_session->request_mutex); } diff --git a/drivers/md/dm-vdo/index.c b/drivers/md/dm-vdo/index.c index 28ae54efaced..3d2a673b3f52 100644 --- a/drivers/md/dm-vdo/index.c +++ b/drivers/md/dm-vdo/index.c @@ -1330,8 +1330,7 @@ int uds_save_index(struct uds_index *index) uds_wait_for_idle_index(index); index->prev_save = index->last_save; index->last_save = ((index->newest_virtual_chapter == 0) ? - NO_LAST_SAVE : - index->newest_virtual_chapter - 1); + NO_LAST_SAVE : index->newest_virtual_chapter - 1); uds_log_info("beginning save (vcn %llu)", (unsigned long long) index->last_save); result = uds_save_index_state(index->layout, index); -- 2.42.0