tdb: remove unused last_ptr
authorBrad Hards <bradh@frogmouth.net>
Tue, 8 Mar 2011 09:28:06 +0000 (20:28 +1100)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 16 Mar 2011 04:14:40 +0000 (14:44 +1030)
ccan/tdb/freelistcheck.c

index 8d1ebabe04e85c9c3650797bde2a83f187b9ce2b..5afcaa2a18967094d074b4232d9d1383e05b640c 100644 (file)
@@ -47,7 +47,7 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
 {
        struct tdb_context *mem_tdb = NULL;
        struct tdb_record rec;
-       tdb_off_t rec_ptr, last_ptr;
+       tdb_off_t rec_ptr;
        int ret = -1;
 
        *pnum_entries = 0;
@@ -63,10 +63,8 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
                return 0;
        }
 
-       last_ptr = FREELIST_TOP;
-
        /* Store the FREELIST_TOP record. */
-       if (seen_insert(mem_tdb, last_ptr) == -1) {
+       if (seen_insert(mem_tdb, FREELIST_TOP) == -1) {
                tdb->ecode = TDB_ERR_CORRUPT;
                ret = -1;
                goto fail;
@@ -94,7 +92,6 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries)
                }
 
                /* move to the next record */
-               last_ptr = rec_ptr;
                rec_ptr = rec.next;
                *pnum_entries += 1;
        }