summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-29 13:59:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:58 +0200
commit6763c6e9536b1c07609b3ae1a00fb419eb35f3f3 (patch)
treed654962f6674cf71a9971d058e569bd7584bc9c1
parentd6ba51fa929d9166ba8038dea02f1ccea20d15cd (diff)
downloaddt-utils-6763c6e9536b1c07609b3ae1a00fb419eb35f3f3.tar.gz
dt-utils-6763c6e9536b1c07609b3ae1a00fb419eb35f3f3.tar.xz
barebox-state: make state_get() definition consistent to its prototype
In 2839d4f6f4 state_get() got an additional argument, but its prototype in barebox-state.h was never adjusted. Include the file containing the prototype from the file containing the function definition so that this bug can be detected by the compiler. Also add the missing argument to the callers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state.c3
-rw-r--r--src/barebox-state.h2
-rw-r--r--src/keystore-blob.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/barebox-state.c b/src/barebox-state.c
index 25f3bc3..a40b32d 100644
--- a/src/barebox-state.c
+++ b/src/barebox-state.c
@@ -34,6 +34,7 @@
#include <mtd/mtd-abi.h>
#include <barebox-state/state.h>
+#include <barebox-state.h>
#include <dt/dt.h>
#include <state.h>
@@ -511,7 +512,7 @@ int main(int argc, char *argv[])
}
list_for_each_entry(state, &state_list.list, list) {
- state->state = state_get(state->name, readonly);
+ state->state = state_get(state->name, readonly, auth);
if (!IS_ERR(state->state) && !state->name)
state->name = state->state->name;
if (IS_ERR(state->state)) {
diff --git a/src/barebox-state.h b/src/barebox-state.h
index 08d5b6e..00c758f 100644
--- a/src/barebox-state.h
+++ b/src/barebox-state.h
@@ -1,7 +1,7 @@
#ifndef __BAREBOX_STATE__
#define __BAREBOX_STATE__
-struct state *state_get(const char *name);
+struct state *state_get(const char *name, bool readonly);
char *state_get_var(struct state *state, const char *var);
#endif /* __BAREBOX_STATE__ */
diff --git a/src/keystore-blob.c b/src/keystore-blob.c
index 089fea7..e3bffb3 100644
--- a/src/keystore-blob.c
+++ b/src/keystore-blob.c
@@ -30,7 +30,7 @@ int keystore_get_secret(const char *name, const unsigned char **key, int *key_le
if (!state) {
struct state *tmp;
- tmp = state_get(keystore_state_name);
+ tmp = state_get(keystore_state_name, true);
if (IS_ERR(tmp))
return PTR_ERR(tmp);
state = tmp;