summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-24 09:02:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:54 +0200
commitd31727fbf7c9c9536ec3b6b8c524c3ce1737f580 (patch)
treed72b6d26ccaba58d068ca4ddc673d3d356da63e7
parentd15fbd19110e0ab78e75748e801f9b1fe8924f7c (diff)
downloaddt-utils-d31727fbf7c9c9536ec3b6b8c524c3ce1737f580.tar.gz
state: backend_storage: Rename variable desired_copies to desired_buckets
We defined what a bucket is, so rename the variable that holds the number of desired buckets from desired_copies to desired_buckets. While at it, make locally used variable static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state/backend_storage.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index e339822..2f3e39d 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -217,8 +217,8 @@ static int mtd_get_meminfo(const char *path, struct mtd_info_user *meminfo)
return ret;
}
-/* Number of copies that should be allocated */
-const int desired_copies = 3;
+/* Number of buckets that should be used */
+static const int desired_buckets = 3;
/**
* state_storage_mtd_buckets_init - Creates storage buckets for mtd devices
@@ -271,7 +271,7 @@ static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
list_add_tail(&bucket->bucket_list, &storage->buckets);
++n_buckets;
- if (n_buckets >= desired_copies)
+ if (n_buckets >= desired_buckets)
return 0;
}
@@ -281,7 +281,7 @@ static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
}
dev_warn(storage->dev, "Failed to initialize desired amount of buckets, only %d of %d succeeded\n",
- n_buckets, desired_copies);
+ n_buckets, desired_buckets);
return 0;
}
@@ -307,12 +307,12 @@ static int state_storage_file_buckets_init(struct state_backend_storage *storage
return -EINVAL;
}
- if (max_size && max_size < desired_copies * stridesize) {
- dev_err(storage->dev, "device is too small to hold %d copies\n", desired_copies);
+ if (max_size && max_size < desired_buckets * stridesize) {
+ dev_err(storage->dev, "device is too small to hold %d copies\n", desired_buckets);
return -EINVAL;
}
- for (n = 0; n < desired_copies; n++) {
+ for (n = 0; n < desired_buckets; n++) {
offset = storage->offset + n * stridesize;
ret = state_backend_bucket_direct_create(storage->dev, storage->path,
&bucket, offset,
@@ -335,9 +335,9 @@ static int state_storage_file_buckets_init(struct state_backend_storage *storage
return -EIO;
}
- if (n_buckets < desired_copies)
+ if (n_buckets < desired_buckets)
dev_warn(storage->dev, "Failed to initialize desired amount of direct buckets, only %d of %d succeeded\n",
- n_buckets, desired_copies);
+ n_buckets, desired_buckets);
return 0;
}