Skip to content

Commit

Permalink
mtd: nand_bbt: refactor check_pattern_no_oob()
Browse files Browse the repository at this point in the history
This function only returns 0 or -1, so make that clear.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Brian Norris authored and David Woodhouse committed Jul 6, 2012
1 parent 9fd6b37 commit 718894a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@

static int check_pattern_no_oob(uint8_t *buf, struct nand_bbt_descr *td)
{
int ret;

ret = memcmp(buf, td->pattern, td->len);
if (!ret)
return ret;
return -1;
if (memcmp(buf, td->pattern, td->len))
return -1;
return 0;
}

/**
Expand Down

0 comments on commit 718894a

Please sign in to comment.