summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-23 15:13:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:17 +0200
commitac5154c3a5939b44049d5e8df365ba04f5daf199 (patch)
tree0742db078929fcbfd8f2205a965317763961e247
parent6893aa7a60a3a308884c85d63ca134a2a4abb8c5 (diff)
downloaddt-utils-ac5154c3a5939b44049d5e8df365ba04f5daf199.tar.gz
state: backend: remove len_hint argument from state_storage_read
The argument is 0 in the only caller, so remove the argument. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state/backend.c3
-rw-r--r--src/barebox-state/backend_storage.c5
-rw-r--r--src/barebox-state/state.h3
3 files changed, 4 insertions, 7 deletions
diff --git a/src/barebox-state/backend.c b/src/barebox-state/backend.c
index 6b06c84..803390e 100644
--- a/src/barebox-state/backend.c
+++ b/src/barebox-state/backend.c
@@ -70,12 +70,11 @@ int state_load(struct state *state)
{
uint8_t *buf;
ssize_t len;
- ssize_t len_hint = 0;
int ret;
struct state_backend *backend = &state->backend;
ret = state_storage_read(&backend->storage, backend->format,
- state->magic, &buf, &len, len_hint);
+ state->magic, &buf, &len);
if (ret) {
dev_err(&state->dev, "Failed to read state with format %s, %d\n",
backend->format->name, ret);
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index 5109a8c..ee7ff06 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -130,14 +130,13 @@ int state_storage_restore_consistency(struct state_backend_storage *storage,
*/
int state_storage_read(struct state_backend_storage *storage,
struct state_backend_format *format,
- uint32_t magic, uint8_t ** buf, ssize_t * len,
- ssize_t len_hint)
+ uint32_t magic, uint8_t ** buf, ssize_t * len)
{
struct state_backend_storage_bucket *bucket;
int ret;
list_for_each_entry(bucket, &storage->buckets, bucket_list) {
- *len = len_hint;
+ *len = 0;
ret = bucket_lazy_init(bucket);
if (ret) {
dev_warn(storage->dev, "Failed to init bucket/read state backend bucket, %d\n",
diff --git a/src/barebox-state/state.h b/src/barebox-state/state.h
index 0197cb8..ddf4523 100644
--- a/src/barebox-state/state.h
+++ b/src/barebox-state/state.h
@@ -234,8 +234,7 @@ int state_storage_restore_consistency(struct state_backend_storage
ssize_t len);
int state_storage_read(struct state_backend_storage *storage,
struct state_backend_format *format,
- uint32_t magic, uint8_t **buf, ssize_t *len,
- ssize_t len_hint);
+ uint32_t magic, uint8_t **buf, ssize_t *len);
static inline struct state_uint32 *to_state_uint32(struct state_variable *s)
{