diff options
Diffstat (limited to 'drivers/io')
-rw-r--r-- | drivers/io/io_block.c | 7 | ||||
-rw-r--r-- | drivers/io/io_fip.c | 5 | ||||
-rw-r--r-- | drivers/io/io_memmap.c | 3 | ||||
-rw-r--r-- | drivers/io/io_semihosting.c | 8 |
4 files changed, 13 insertions, 10 deletions
diff --git a/drivers/io/io_block.c b/drivers/io/io_block.c index 4ec59bc7..a855581b 100644 --- a/drivers/io/io_block.c +++ b/drivers/io/io_block.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -36,6 +36,7 @@ #include <io_storage.h> #include <platform_def.h> #include <string.h> +#include <utils.h> typedef struct { io_block_dev_spec_t *dev_spec; @@ -135,8 +136,8 @@ static int free_dev_info(io_dev_info_t *dev_info) result = find_first_block_state(state->dev_spec, &index); if (result == 0) { /* free if device info is valid */ - memset(state, 0, sizeof(block_dev_state_t)); - memset(dev_info, 0, sizeof(io_dev_info_t)); + zeromem(state, sizeof(block_dev_state_t)); + zeromem(dev_info, sizeof(io_dev_info_t)); --block_dev_count; } diff --git a/drivers/io/io_fip.c b/drivers/io/io_fip.c index 99cf15b9..6724fc3b 100644 --- a/drivers/io/io_fip.c +++ b/drivers/io/io_fip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2014-2017, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -40,6 +40,7 @@ #include <platform_def.h> #include <stdint.h> #include <string.h> +#include <utils.h> #include <uuid.h> /* Useful for printing UUIDs when debugging.*/ @@ -351,7 +352,7 @@ static int fip_file_close(io_entity_t *entity) * If we had malloc() we would free() here. */ if (current_file.entry.offset_address != 0) { - memset(¤t_file, 0, sizeof(current_file)); + zeromem(¤t_file, sizeof(current_file)); } /* Clear the Entity info. */ diff --git a/drivers/io/io_memmap.c b/drivers/io/io_memmap.c index 90b8e257..5104fb19 100644 --- a/drivers/io/io_memmap.c +++ b/drivers/io/io_memmap.c @@ -33,6 +33,7 @@ #include <io_driver.h> #include <io_storage.h> #include <string.h> +#include <utils.h> /* As we need to be able to keep state for seek, only one file can be open * at a time. Make this a structure and point to the entity->info. When we @@ -249,7 +250,7 @@ static int memmap_block_close(io_entity_t *entity) entity->info = 0; /* This would be a mem free() if we had malloc.*/ - memset((void *)¤t_file, 0, sizeof(current_file)); + zeromem((void *)¤t_file, sizeof(current_file)); return 0; } diff --git a/drivers/io/io_semihosting.c b/drivers/io/io_semihosting.c index 30ca99cb..e33a044d 100644 --- a/drivers/io/io_semihosting.c +++ b/drivers/io/io_semihosting.c @@ -95,7 +95,7 @@ static int sh_file_open(io_dev_info_t *dev_info __unused, const uintptr_t spec, io_entity_t *entity) { int result = -ENOENT; - long sh_result = -1; + long sh_result; const io_file_spec_t *file_spec = (const io_file_spec_t *)spec; assert(file_spec != NULL); @@ -151,7 +151,7 @@ static int sh_file_read(io_entity_t *entity, uintptr_t buffer, size_t length, size_t *length_read) { int result = -ENOENT; - long sh_result = -1; + long sh_result; size_t bytes = length; long file_handle; @@ -176,7 +176,7 @@ static int sh_file_read(io_entity_t *entity, uintptr_t buffer, size_t length, static int sh_file_write(io_entity_t *entity, const uintptr_t buffer, size_t length, size_t *length_written) { - long sh_result = -1; + long sh_result; long file_handle; size_t bytes = length; @@ -197,7 +197,7 @@ static int sh_file_write(io_entity_t *entity, const uintptr_t buffer, /* Close a file on the semi-hosting device */ static int sh_file_close(io_entity_t *entity) { - long sh_result = -1; + long sh_result; long file_handle; assert(entity != NULL); |