Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce0c8e05 authored by Andre Noll's avatar Andre Noll Committed by Neil Brown
Browse files

md: Simplify sb_equal().



The only caller of sb_equal() tests the return value against
zero, so it's OK to return the negated return value of memcmp().

Signed-off-by: default avatarAndre Noll <maan@systemlinux.org>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
parent 05710466
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -572,11 +572,7 @@ static int sb_equal(mdp_super_t *sb1, mdp_super_t *sb2)
	tmp1->nr_disks = 0;
	tmp2->nr_disks = 0;

	if (memcmp(tmp1, tmp2, MD_SB_GENERIC_CONSTANT_WORDS * 4))
		ret = 0;
	else
		ret = 1;

	ret = (memcmp(tmp1, tmp2, MD_SB_GENERIC_CONSTANT_WORDS * 4) == 0);
abort:
	kfree(tmp1);
	kfree(tmp2);