aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLedion Daja <ledion.daja@arm.com>2023-02-17 09:58:00 +0100
committerLedion Daja <ledion.daja@arm.com>2023-03-14 11:21:57 +0100
commitf1dada304a552cc19d27d0506d16040ff787c0c1 (patch)
tree21fed39b1ffbc51bde5556d1edf543030c86ba8b /lib
parentd88c1c55da398c1e9935cffe412f079a5e6c7a81 (diff)
downloadethos-u-core-software-f1dada304a552cc19d27d0506d16040ff787c0c1.tar.gz
Fix SEI CERT coding standard warnings
Change-Id: I831e4546832aeae22c48b92cd2e8adfac797e704
Diffstat (limited to 'lib')
-rw-r--r--lib/ethosu_log/include/ethosu_log.h13
-rw-r--r--lib/ethosu_monitor/include/ethosu_monitor.hpp4
2 files changed, 9 insertions, 8 deletions
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 <open-source-office@arm.com>
*
* 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 <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
*
* 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<ethosu_pmu_event_type>(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);