diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2018-08-22 09:55:15 +0200 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2018-08-24 11:38:28 +0000 |
commit | 0a7d6908bf0daa95b2a689cb293662c175eeb3e7 (patch) | |
tree | a0668237a490141dd7ddff850f47d9daec446178 /src/lib/fit.c | |
parent | 240eaaad284d52c812c222305fae41993cef71ac (diff) |
device_tree/fit: Constify data structures
* Add const quailifier to arguments and elements.
* Add casts where necessary in cn81xx/soc.
Tested on Cavium CN81xx EVB SFF.
Change-Id: Id27966427fb97457fe883be32685d1397fb0781f
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/28267
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/lib/fit.c')
-rw-r--r-- | src/lib/fit.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/fit.c b/src/lib/fit.c index 68f5bed2b8..da550723d2 100644 --- a/src/lib/fit.c +++ b/src/lib/fit.c @@ -158,7 +158,7 @@ static struct fit_image_node *find_image(const char *name) return NULL; } -static int fdt_find_compat(void *blob, uint32_t start_offset, +static int fdt_find_compat(const void *blob, uint32_t start_offset, struct fdt_property *prop) { int offset = start_offset; @@ -196,7 +196,7 @@ static int fit_check_compat(struct fdt_property *compat_prop, return -1; } -void fit_update_chosen(struct device_tree *tree, char *cmd_line) +void fit_update_chosen(struct device_tree *tree, const char *cmd_line) { const char *path[] = { "chosen", NULL }; struct device_tree_node *node; @@ -388,10 +388,12 @@ void fit_update_memory(struct device_tree *tree) * @param fdt_blob Pointer to FDT * @param config The current config node to operate on */ -static void fit_update_compat(void *fdt_blob, struct fit_config_node *config) +static void fit_update_compat(const void *fdt_blob, + struct fit_config_node *config) { struct compat_string_entry *compat_node; - struct fdt_header *fdt_header = (struct fdt_header *)fdt_blob; + const struct fdt_header *fdt_header = + (const struct fdt_header *)fdt_blob; uint32_t fdt_offset = be32_to_cpu(fdt_header->structure_offset); size_t i = 0; |