md: factor out a helper to choose sync action from md_check_recovery()
authorYu Kuai <yukuai3@huawei.com>
Fri, 25 Aug 2023 03:16:17 +0000 (11:16 +0800)
committerSong Liu <song@kernel.org>
Fri, 22 Sep 2023 17:28:25 +0000 (10:28 -0700)
commit897c62a1cae6485870a45934b22c180016a0570f
tree68614abfca95cf5d9fa346e312d26691b38b796f
parentac619781967bd5663c29606246b50dbebd8b3473
md: factor out a helper to choose sync action from md_check_recovery()

There are no functional changes, on the one hand make the code cleaner,
on the other hand prevent following checkpatch error in the next patch to
delay choosing sync action to md_start_sync().

ERROR: do not use assignment in if condition
+       } else if ((spares = remove_and_add_spares(mddev, NULL))) {

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230825031622.1530464-3-yukuai1@huaweicloud.com
drivers/md/md.c