summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-24 08:58:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:53 +0200
commitd15fbd19110e0ab78e75748e801f9b1fe8924f7c (patch)
tree3df02efac12dd724f5137ea23f4557211602cad8
parent84895c1929e6ed38ac7b941f632892b42672d238 (diff)
downloaddt-utils-d15fbd19110e0ab78e75748e801f9b1fe8924f7c.tar.gz
state: backend_storage: Rename variable nr_copies to n_buckets
We defined what a bucket is, so use n_buckets when counting buckets, and not nr_copies. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state/backend_storage.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index 2b21481..e339822 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -236,7 +236,7 @@ static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
{
struct state_backend_storage_bucket *bucket;
ssize_t end = storage->offset + storage->max_size;
- int nr_copies = 0;
+ int n_buckets = 0;
off_t offset;
ssize_t writesize;
@@ -267,21 +267,21 @@ static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
continue;
bucket->offset = offset;
- bucket->num = nr_copies;
+ bucket->num = n_buckets;
list_add_tail(&bucket->bucket_list, &storage->buckets);
- ++nr_copies;
- if (nr_copies >= desired_copies)
+ ++n_buckets;
+ if (n_buckets >= desired_copies)
return 0;
}
- if (!nr_copies) {
+ if (!n_buckets) {
dev_err(storage->dev, "Failed to initialize any state storage bucket\n");
return -EIO;
}
dev_warn(storage->dev, "Failed to initialize desired amount of buckets, only %d of %d succeeded\n",
- nr_copies, desired_copies);
+ n_buckets, desired_copies);
return 0;
}
@@ -298,7 +298,7 @@ static int state_storage_file_buckets_init(struct state_backend_storage *storage
struct state_backend_storage_bucket *bucket;
int ret, n;
off_t offset;
- int nr_copies = 0;
+ int n_buckets = 0;
uint32_t stridesize = storage->stridesize;
size_t max_size = storage->max_size;
@@ -324,20 +324,20 @@ static int state_storage_file_buckets_init(struct state_backend_storage *storage
}
bucket->offset = offset;
- bucket->num = nr_copies;
+ bucket->num = n_buckets;
list_add_tail(&bucket->bucket_list, &storage->buckets);
- ++nr_copies;
+ ++n_buckets;
}
- if (!nr_copies) {
+ if (!n_buckets) {
dev_err(storage->dev, "Failed to initialize any state direct storage bucket\n");
return -EIO;
}
- if (nr_copies < desired_copies)
+ if (n_buckets < desired_copies)
dev_warn(storage->dev, "Failed to initialize desired amount of direct buckets, only %d of %d succeeded\n",
- nr_copies, desired_copies);
+ n_buckets, desired_copies);
return 0;
}