[PATCH 04/42] state: backend: remove len_hint argument from state_storage_read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The argument is 0 in the only caller, so remove the argument.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 common/state/backend.c         | 3 +--
 common/state/backend_storage.c | 5 ++---
 common/state/state.h           | 3 +--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/common/state/backend.c b/common/state/backend.c
index 6b06c845f0..803390e2aa 100644
--- a/common/state/backend.c
+++ b/common/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/common/state/backend_storage.c b/common/state/backend_storage.c
index d7bd147441..5481f27df9 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -129,14 +129,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/common/state/state.h b/common/state/state.h
index 0197cb839a..ddf45239eb 100644
--- a/common/state/state.h
+++ b/common/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)
 {
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux