[PATCH 2/2] libubi: Use global mtd_all_ff function

Sascha Hauer s.hauer at pengutronix.de
Wed Feb 20 05:47:50 EST 2013


We introduced a global function for this, so use it.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 lib/libscan.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/lib/libscan.c b/lib/libscan.c
index af55269..202266b 100644
--- a/lib/libscan.c
+++ b/lib/libscan.c
@@ -33,17 +33,6 @@
 #include <mtd/ubi-media.h>
 #include <asm-generic/div64.h>
 
-static int all_ff(const void *buf, int len)
-{
-	int i;
-	const uint8_t *p = buf;
-
-	for (i = 0; i < len; i++)
-		if (p[i] != 0xFF)
-			return 0;
-	return 1;
-}
-
 int libscan_ubi_scan(struct mtd_dev_info *mtd, int fd, struct ubi_scan_info **info,
 	     int verbose)
 {
@@ -95,7 +84,7 @@ int libscan_ubi_scan(struct mtd_dev_info *mtd, int fd, struct ubi_scan_info **in
 			goto out_ec;
 
 		if (be32_to_cpu(ech.magic) != UBI_EC_HDR_MAGIC) {
-			if (all_ff(&ech, sizeof(struct ubi_ec_hdr))) {
+			if (mtd_all_ff(&ech, sizeof(struct ubi_ec_hdr))) {
 				si->empty_cnt += 1;
 				si->ec[eb] = EB_EMPTY;
 				if (v)
-- 
1.7.10.4




More information about the barebox mailing list