summaryrefslogtreecommitdiffstats
path: root/common/state/backend_storage.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-21 15:45:23 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 18:43:53 +0200
commit38db53de7a9716e3fe2560c89afe2172b04e3d5e (patch)
tree1bee9e8274a28aaf84e6b7a5e7f1babbbd7a081c /common/state/backend_storage.c
parent99020ca016f5569a14ef7571384a0205f13522e8 (diff)
downloadbarebox-38db53de7a9716e3fe2560c89afe2172b04e3d5e.tar.gz
barebox-38db53de7a9716e3fe2560c89afe2172b04e3d5e.tar.xz
state: Use positive logic
bools with "non" in the names are rather confusing. Switch to positive logic. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/state/backend_storage.c')
-rw-r--r--common/state/backend_storage.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c
index 5dc8c50267..d7bd147441 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -249,7 +249,7 @@ const int desired_copies = 3;
* @param storage Storage object
* @param meminfo Info about the mtd device
* @param path Path to the device
- * @param non_circular Use non-circular mode to write data that is compatible with the old on-flash format
+ * @param circular If false, use non-circular mode to write data that is compatible with the old on-flash format
* @param dev_offset Offset to start at in the device.
* @param max_size Maximum size to use for data. May be 0 for infinite.
* @return 0 on success, -errno otherwise
@@ -262,7 +262,7 @@ const int desired_copies = 3;
*/
static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
struct mtd_info_user *meminfo,
- const char *path, bool non_circular,
+ const char *path, bool circular,
off_t dev_offset, size_t max_size)
{
struct state_backend_storage_bucket *bucket;
@@ -285,7 +285,7 @@ static int state_storage_mtd_buckets_init(struct state_backend_storage *storage,
unsigned int eraseblock = offset / meminfo->erasesize;
bool lazy_init = true;
- if (non_circular)
+ if (!circular)
writesize = meminfo->erasesize;
ret = state_backend_bucket_circular_create(storage->dev, path,
@@ -483,16 +483,16 @@ int state_storage_init(struct state_backend_storage *storage,
ret = mtd_get_meminfo(path, &meminfo);
if (!ret && !(meminfo.flags & MTD_NO_ERASE)) {
- bool non_circular = false;
+ bool circular = true;
if (!storagetype) {
- non_circular = true;
+ circular = false;
} else if (strcmp(storagetype, "circular")) {
dev_warn(storage->dev, "Unknown storagetype '%s', falling back to old format circular storage type.\n",
storagetype);
- non_circular = true;
+ circular = false;
}
return state_storage_mtd_buckets_init(storage, &meminfo, path,
- non_circular, offset,
+ circular, offset,
max_size);
} else {
return state_storage_file_buckets_init(storage, path, offset,