diff options
author | Mikael Olsson <mikael.olsson@arm.com> | 2023-10-31 10:49:06 +0100 |
---|---|---|
committer | Mikael Olsson <mikael.olsson@arm.com> | 2023-11-01 13:15:03 +0100 |
commit | c1a418d61ab9930096b05517ae11655bf590c4b2 (patch) | |
tree | 17edff9e9b61afc97c90f20d995719053c8ed9c4 /kernel/CMakeLists.txt | |
parent | edd2550cd909b584610ac18387b3261a4f50b392 (diff) | |
download | ethos-u-linux-driver-stack-c1a418d61ab9930096b05517ae11655bf590c4b2.tar.gz |
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>
Diffstat (limited to 'kernel/CMakeLists.txt')
-rw-r--r-- | kernel/CMakeLists.txt | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 236b0ea..fb435ec 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -1,5 +1,6 @@ # -# Copyright (c) 2020-2022 Arm Limited. +# 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) @@ -34,7 +33,7 @@ file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c" "*.h") # Build the kernel module add_custom_target(kernel ALL - COMMAND ${CMAKE_MAKE_PROGRAM} -C ${KDIR} M=${CMAKE_CURRENT_SOURCE_DIR} CONFIG_ETHOSU=m CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} modules + COMMAND ${CMAKE_MAKE_PROGRAM} -C ${KDIR} C=2 M=${CMAKE_CURRENT_SOURCE_DIR} CONFIG_ETHOSU=m CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} modules BYPRODUCTS ethosu.ko DEPENDS ${SOURCES} Kbuild Kconfig COMMENT "Building ethosu.ko" |