tegra: hwpm: Simplify CONFTEST presence check

The variable 'NV_BUILD_SYSTEM_TYPE' is an NVIDIA internal Makefile
variable used for building the Linux kernel. We should avoid using this
in drivers where possible because otherwise it will require external
users to set this.

CONFTEST itself is not internal and is distributed with the NVIDIA OOT
drivers. Rather than using 'NV_BUILD_SYSTEM_TYPE' to see if CONFTEST is
presence, we can simply see if the 'srctree.conftest' variable is set
and avoid using 'NV_BUILD_SYSTEM_TYPE' at all.

Furthermore, given that the variable 'CONFIG_TEGRA_HWPM_CONFTEST' now
defines if CONFTEST is present and this will only be set in the Makefile
if 'CONFIG_TEGRA_HWPM_OOT' is set, then we don't need to check for both
of these variables in the source files to determine if we need to
include 'nvidia/conftest.h'.

Bug 5120925

Change-Id: If9f6cebc7cc38414fce10a445ed090ba345e5002
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3318049
Reviewed-by: Yifei Wan <ywan@nvidia.com>
Reviewed-by: Besar Wicaksono <bwicaksono@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
This commit is contained in:
Jon Hunter
2025-03-12 10:00:44 +00:00
committed by mobile promotions
parent 4fbceccafa
commit 742e79fa06
4 changed files with 4 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ ccflags-y += -DCONFIG_TEGRA_HWPM_OOT
CONFIG_TEGRA_FUSE_UPSTREAM := y
ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM
ifneq ($(NV_BUILD_SYSTEM_TYPE),)
ifneq ($(srctree.nvconftest),)
ccflags-y += -DCONFIG_TEGRA_HWPM_CONFTEST
ccflags-y += -I$(srctree.nvconftest)
endif

View File

@@ -10,7 +10,7 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#if defined(CONFIG_TEGRA_HWPM_CONFTEST) && defined(CONFIG_TEGRA_HWPM_OOT)
#if defined(CONFIG_TEGRA_HWPM_CONFTEST)
#include <nvidia/conftest.h>
#endif

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#if defined(CONFIG_TEGRA_HWPM_CONFTEST) && defined(CONFIG_TEGRA_HWPM_OOT)
#if defined(CONFIG_TEGRA_HWPM_CONFTEST)
#include <nvidia/conftest.h>
#endif
#include <linux/mm.h>

View File

@@ -17,7 +17,7 @@
#ifndef TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H
#define TEGRA_HWPM_OS_LINUX_MEM_MGMT_UTILS_H
#if defined(CONFIG_TEGRA_HWPM_CONFTEST) && defined(CONFIG_TEGRA_HWPM_OOT)
#if defined(CONFIG_TEGRA_HWPM_CONFTEST)
#include <nvidia/conftest.h>
#endif