]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
md: Simplify sb_equal().
authorAndre Noll <maan@systemlinux.org>
Fri, 11 Jul 2008 12:02:20 +0000 (22:02 +1000)
committerNeil Brown <neilb@suse.de>
Fri, 11 Jul 2008 12:02:20 +0000 (22:02 +1000)
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: Andre Noll <maan@systemlinux.org>
Signed-off-by: Neil Brown <neilb@suse.de>
drivers/md/md.c

index 8a03c953b887ad08d25ae67ca4d2aac9b07af4c8..20e03db8fdfcac048de4c8460b992d407cc6f0f3 100644 (file)
@@ -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);