From dbc6eb236bb56a8cbc0b7876914aeea880a85a53 Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux Date: Thu, 15 May 2014 17:15:20 +0100 Subject: [PATCH] juno: Constify some variables Mark some of the variables in the juno code as 'const' where possible. Change-Id: I14b19cccff5993c08a0ca11cd42e57d5435081f4 --- plat/juno/plat_io_storage.c | 16 ++++++++-------- plat/juno/plat_pm.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plat/juno/plat_io_storage.c b/plat/juno/plat_io_storage.c index 5893b5e64..6dbc27f06 100644 --- a/plat/juno/plat_io_storage.c +++ b/plat/juno/plat_io_storage.c @@ -48,27 +48,27 @@ static uintptr_t memmap_dev_spec; static uintptr_t memmap_init_params; static uintptr_t memmap_dev_handle; -static io_block_spec_t fip_block_spec = { +static const io_block_spec_t fip_block_spec = { .offset = FLASH_BASE, .length = FLASH_SIZE }; -static io_file_spec_t bl2_file_spec = { +static const io_file_spec_t bl2_file_spec = { .path = BL2_IMAGE_NAME, .mode = FOPEN_MODE_RB }; -static io_file_spec_t bl30_file_spec = { +static const io_file_spec_t bl30_file_spec = { .path = BL30_IMAGE_NAME, .mode = FOPEN_MODE_RB }; -static io_file_spec_t bl31_file_spec = { +static const io_file_spec_t bl31_file_spec = { .path = BL31_IMAGE_NAME, .mode = FOPEN_MODE_RB }; -static io_file_spec_t bl33_file_spec = { +static const io_file_spec_t bl33_file_spec = { .path = BL33_IMAGE_NAME, .mode = FOPEN_MODE_RB }; @@ -77,13 +77,13 @@ static int open_fip(const uintptr_t spec); static int open_memmap(const uintptr_t spec); struct plat_io_policy { - char *image_name; + const char *image_name; uintptr_t *dev_handle; uintptr_t image_spec; int (*check)(const uintptr_t spec); }; -static struct plat_io_policy policies[] = { +static const struct plat_io_policy policies[] = { { FIP_IMAGE_NAME, &memmap_dev_handle, @@ -178,7 +178,7 @@ int plat_get_image_source(const char *image_name, uintptr_t *dev_handle, uintptr_t *image_spec) { int result = IO_FAIL; - struct plat_io_policy *policy; + const struct plat_io_policy *policy; if ((image_name != NULL) && (dev_handle != NULL) && (image_spec != NULL)) { diff --git a/plat/juno/plat_pm.c b/plat/juno/plat_pm.c index d301a7456..87b9d8cff 100644 --- a/plat/juno/plat_pm.c +++ b/plat/juno/plat_pm.c @@ -145,7 +145,7 @@ int pm_off(unsigned long mpidr, unsigned int afflvl, unsigned int state) /******************************************************************************* * Export the platform handlers to enable psci to invoke them ******************************************************************************/ -static plat_pm_ops_t pm_ops = { +static const plat_pm_ops_t pm_ops = { .affinst_on = pm_on, .affinst_on_finish = pm_on_finish, .affinst_off = pm_off -- GitLab