From f1dada304a552cc19d27d0506d16040ff787c0c1 Mon Sep 17 00:00:00 2001 From: Ledion Daja Date: Fri, 17 Feb 2023 09:58:00 +0100 Subject: Fix SEI CERT coding standard warnings Change-Id: I831e4546832aeae22c48b92cd2e8adfac797e704 --- lib/ethosu_log/include/ethosu_log.h | 13 +++++++------ lib/ethosu_monitor/include/ethosu_monitor.hpp | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/ethosu_log/include/ethosu_log.h b/lib/ethosu_log/include/ethosu_log.h index bd460b3..4c91264 100644 --- a/lib/ethosu_log/include/ethosu_log.h +++ b/lib/ethosu_log/include/ethosu_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. All rights reserved. + * SPDX-FileCopyrightText: Copyright 2021, 2023 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -43,28 +43,29 @@ // Log formatting -#define LOG(f, ...) fprintf(stdout, f, ##__VA_ARGS__) +#define LOG(f, ...) (void)fprintf(stdout, f, ##__VA_ARGS__) #if ETHOSU_LOG_SEVERITY >= ETHOSU_LOG_ERR -#define LOG_ERR(f, ...) fprintf(stderr, "E: " f " (%s:%d)\n", ##__VA_ARGS__, strrchr("/" __FILE__, '/') + 1, __LINE__) +#define LOG_ERR(f, ...) \ + (void)fprintf(stderr, "E: " f " (%s:%d)\n", ##__VA_ARGS__, strrchr("/" __FILE__, '/') + 1, __LINE__) #else #define LOG_ERR(f, ...) #endif #if ETHOSU_LOG_SEVERITY >= ETHOSU_LOG_WARN -#define LOG_WARN(f, ...) fprintf(stdout, "W: " f "\n", ##__VA_ARGS__) +#define LOG_WARN(f, ...) (void)fprintf(stdout, "W: " f "\n", ##__VA_ARGS__) #else #define LOG_WARN(f, ...) #endif #if ETHOSU_LOG_SEVERITY >= ETHOSU_LOG_INFO -#define LOG_INFO(f, ...) fprintf(stdout, "I: " f "\n", ##__VA_ARGS__) +#define LOG_INFO(f, ...) (void)fprintf(stdout, "I: " f "\n", ##__VA_ARGS__) #else #define LOG_INFO(f, ...) #endif #if ETHOSU_LOG_SEVERITY >= ETHOSU_LOG_DEBUG -#define LOG_DEBUG(f, ...) fprintf(stdout, "D: %s(): " f "\n", __FUNCTION__, ##__VA_ARGS__) +#define LOG_DEBUG(f, ...) (void)fprintf(stdout, "D: %s(): " f "\n", __FUNCTION__, ##__VA_ARGS__) #else #define LOG_DEBUG(f, ...) #endif diff --git a/lib/ethosu_monitor/include/ethosu_monitor.hpp b/lib/ethosu_monitor/include/ethosu_monitor.hpp index 2bdeb4a..4ef5821 100644 --- a/lib/ethosu_monitor/include/ethosu_monitor.hpp +++ b/lib/ethosu_monitor/include/ethosu_monitor.hpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates + * SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates * * SPDX-License-Identifier: Apache-2.0 * @@ -56,7 +56,7 @@ public: for (size_t i = 0; i < ETHOSU_PMU_NCOUNTERS; i++) { ETHOSU_PMU_Set_EVTYPER(drv, i, static_cast(ethosuEventIds[i])); - ETHOSU_PMU_CNTR_Enable(drv, 1 << i); + ETHOSU_PMU_CNTR_Enable(drv, 1u << i); } ETHOSU_PMU_CNTR_Enable(drv, ETHOSU_PMU_CCNT_Msk); -- cgit v1.2.1