On Thu, Jan 31, 2019 at 7:32 PM Yufen Yu <yuyufen@xxxxxxxxxx> wrote: > > Remove redundance set_bit and let code simplify. > > Signed-off-by: Yufen Yu <yuyufen@xxxxxxxxxx> Applied to https://github.com/liu-song-6/linux/tree/md-next Thanks! Song > --- > drivers/md/raid1.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c > index 4e990246225e..095c55e5dae4 100644 > --- a/drivers/md/raid1.c > +++ b/drivers/md/raid1.c > @@ -1603,11 +1603,9 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev) > return; > } > set_bit(Blocked, &rdev->flags); > - if (test_and_clear_bit(In_sync, &rdev->flags)) { > + if (test_and_clear_bit(In_sync, &rdev->flags)) > mddev->degraded++; > - set_bit(Faulty, &rdev->flags); > - } else > - set_bit(Faulty, &rdev->flags); > + set_bit(Faulty, &rdev->flags); > spin_unlock_irqrestore(&conf->device_lock, flags); > /* > * if recovery is running, make sure it aborts. > -- > 2.14.4 >