diff options
author | Abbas Bracken Ziad <abbas.brackenziad@arm.com> | 2021-09-06 15:16:35 +0100 |
---|---|---|
committer | Antonio de Angelis <Antonio.deAngelis@arm.com> | 2021-09-16 10:20:50 +0200 |
commit | 544b4c8a5b4602c91e46fbccfd8ef1be1d787fc2 (patch) | |
tree | 6e582db5bff28dc187e6705774a793eb1c0015b4 /platform | |
parent | 8444011d03733e0855d36d1c59d68c2159cb1b0a (diff) | |
download | trusted-firmware-m-544b4c8a5b4602c91e46fbccfd8ef1be1d787fc2.tar.gz |
CC312: void unused 'level' parameter in `CC_PalLog`
The `level` parameter in `CC_PalLog` is unused, so void it to suppress
compiler warning. Also, remove narrowing conversion from `size_t` to
`int` by defining `format_len` as `size_t`, and correct indentation
(3 -> 4 spaces).
Signed-off-by: Abbas Bracken Ziad <abbas.brackenziad@arm.com>
Change-Id: I689932e163b6db5c19c0ed6ec5f6e2dd2fd9892f
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ext/accelerator/cc312/cc312_log.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/platform/ext/accelerator/cc312/cc312_log.c b/platform/ext/accelerator/cc312/cc312_log.c index de73c664a5..694e9eeb14 100644 --- a/platform/ext/accelerator/cc312/cc312_log.c +++ b/platform/ext/accelerator/cc312/cc312_log.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Arm Limited. All rights reserved. + * Copyright (c) 2019-2021, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * @@ -24,22 +24,23 @@ void CC_PalLogInit(void){} void CC_PalLog(int level, const char* format, ...) { - char buf[CC312_LOG_BUF_SIZE] = {0}; - va_list args; - int format_len = strlen(format); + (void) level; - if (format_len + 2 > CC312_LOG_BUF_SIZE) - { - printf("CC312 logging error: Message too long\r\n"); - return; - } + char buf[CC312_LOG_BUF_SIZE] = {0}; + va_list args; + size_t format_len = strlen(format); + if (format_len + 2 > CC312_LOG_BUF_SIZE) { + printf("CC312 logging error: Message too long\r\n"); + return; + } - va_start(args, format); + va_start(args, format); - /* CC312 lib doesn't insert CR characters so it's done here */ - strcpy(buf, format); - buf[format_len] = '\r'; + /* CC312 lib doesn't insert CR characters, so it's done here */ + strcpy(buf, format); + buf[format_len] = '\r'; - vprintf(buf, args); + // TODO: replace with print function that works at higher isolation levels + vprintf(buf, args); } |