Add Sparse checking to kernel module builds

Sparse is a semantic checker for C that can help find potential issues
in the kernel module code. To make use of the tool, the CMake files for
the kernel modules have been updated to enable the tool to run on all
the kernel module source files before they are built.

Change-Id: I114920448763b69eb0bdfb9ab6ec51ea8b940881
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
diff --git a/remoteproc/CMakeLists.txt b/remoteproc/CMakeLists.txt
index 86cef2c..c7f7ab8 100644
--- a/remoteproc/CMakeLists.txt
+++ b/remoteproc/CMakeLists.txt
@@ -1,5 +1,6 @@
 #
-# Copyright (c) 2020-2022 Arm Limited. All rights reserved.
+# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+# SPDX-License-Identifier: GPL-2.0-only
 #
 # This program is free software and is provided to you under the terms of the
 # GNU General Public License version 2 as published by the Free Software
@@ -15,8 +16,6 @@
 # along with this program; if not, you can access it online at
 # http://www.gnu.org/licenses/gpl-2.0.html.
 #
-# SPDX-License-Identifier: GPL-2.0-only
-#
 
 cmake_minimum_required(VERSION 3.0.2)
 
@@ -41,7 +40,7 @@
 # Build the kernel module
 add_custom_target(ethosu-remoteproc-module ALL
     COMMAND ${CMAKE_MAKE_PROGRAM} -C ${KDIR}
-    EXTRA_CFLAGS=-I${KDIR}/../../../drivers/remoteproc M=${CMAKE_CURRENT_SOURCE_DIR}
+    EXTRA_CFLAGS=-I${KDIR}/../../../drivers/remoteproc C=2 M=${CMAKE_CURRENT_SOURCE_DIR}
                   ${MODULES}
                   CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} modules
                   BYPRODUCTS