]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
Fix minor issues found by cppcheck
authordp-arm <dimitris.papastamos@arm.com>
Thu, 9 Feb 2017 10:25:29 +0000 (10:25 +0000)
committerdp-arm <dimitris.papastamos@arm.com>
Tue, 14 Feb 2017 17:00:01 +0000 (17:00 +0000)
cppcheck highlighted variables that were initialized but then later
reassigned.

Change-Id: Ie12742c01fd3bf48b2d6c05a3b448da91d57a2e4
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
drivers/io/io_semihosting.c
tools/cert_create/src/ext.c

index 30ca99cb337b0eedd6701e77c29436502332c8c4..e33a044df4a6f01d44e86c862197cfb4205a56a6 100644 (file)
@@ -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);
index 3f56edb756c25f910b19f9ed35b90e1003c93f9e..ad026623d85c9020ef10bcbbc5124fad02a98dc9 100644 (file)
@@ -257,7 +257,7 @@ X509_EXTENSION *ext_new_nvcounter(int nid, int crit, int value)
        X509_EXTENSION *ex = NULL;
        ASN1_INTEGER *counter = NULL;
        unsigned char *p = NULL;
-       int sz = -1;
+       int sz;
 
        /* Encode counter */
        counter = ASN1_INTEGER_new();