Fix SEI CERT coding standard warnings

Change-Id: I831e4546832aeae22c48b92cd2e8adfac797e704
diff --git a/applications/inference_process/src/inference_process.cpp b/applications/inference_process/src/inference_process.cpp
index 88bc8f4..a5bf642 100644
--- a/applications/inference_process/src/inference_process.cpp
+++ b/applications/inference_process/src/inference_process.cpp
@@ -1,5 +1,5 @@
 /*
- * SPDX-FileCopyrightText: Copyright 2019-2022 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2019-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -220,7 +220,7 @@
     for (size_t i = 0; i < interpreter.inputs_size(); ++i) {
         TfLiteTensor *tensor = interpreter.input(i);
 
-        if (tensor->bytes > 0) {
+        if (tensor != nullptr && tensor->bytes > 0) {
             inputTensors.push_back(tensor);
         }
     }
@@ -267,8 +267,11 @@
         DataPtr &output      = job.output[i];
         TfLiteTensor *tensor = interpreter.output(i);
 
+        if (tensor == nullptr) {
+            return true;
+        }
         if (tensor->bytes > output.size) {
-            LOG_ERR("Tensor size mismatch: tensor=%d, expected=%d", tensor->bytes, output.size);
+            LOG_ERR("Tensor size mismatch: tensor=%u, expected=%u", tensor->bytes, output.size);
             return true;
         }
 
@@ -296,6 +299,9 @@
         const DataPtr &expected    = job.expectedOutput[i];
         const TfLiteTensor *output = interpreter.output(i);
 
+        if (output == nullptr) {
+            return true;
+        }
         if (expected.size != output->bytes) {
             LOG_ERR("Expected output tensor size mismatch: job=%s, index=%u, expected=%zu, network=%zu",
                     job.name.c_str(),
@@ -328,7 +334,7 @@
 
     // Print all of the output data, or the first NUM_BYTES_TO_PRINT bytes,
     // whichever comes first as well as the output shape.
-    LOG("num_of_outputs: %d\n", interpreter.outputs_size());
+    LOG("num_of_outputs: %u\n", interpreter.outputs_size());
     LOG("output_begin\n");
     LOG("[\n");
 
@@ -345,10 +351,10 @@
 }
 
 void InferenceProcess::printOutputTensor(TfLiteTensor *output, size_t bytesToPrint) {
-    constexpr auto crc        = Crc();
-    const uint32_t crc32      = crc.crc32(output->data.data, output->bytes);
-    const int numBytesToPrint = min(output->bytes, bytesToPrint);
-    int dims_size             = output->dims->size;
+    constexpr auto crc           = Crc();
+    const uint32_t crc32         = crc.crc32(output->data.data, output->bytes);
+    const size_t numBytesToPrint = min(output->bytes, bytesToPrint);
+    int dims_size                = output->dims->size;
 
     LOG("{\n");
     LOG("\"dims\": [%d,", dims_size);
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 @@
 
         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);