summaryrefslogtreecommitdiffstats
path: root/src
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 13:57:17 +0200
commit8f8931994495e187aba298f76edefdd27b643b54 (patch)
tree7e1b6db01380460f5a9210dc3995c14940dc5c56 /src
parent1af4f599c2b2047dc09ebf2954583f7d85d09a6a (diff)
downloaddt-utils-8f8931994495e187aba298f76edefdd27b643b54.tar.gz
dt-utils-8f8931994495e187aba298f76edefdd27b643b54.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 'src')
-rw-r--r--src/barebox-state/backend_storage.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index 82b77c5..5109a8c 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -250,7 +250,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
@@ -263,7 +263,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;
@@ -286,7 +286,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,
@@ -482,16 +482,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,