From 8d2b43c6dc1a5b04d83bc4eb90495ca19ef40c1d Mon Sep 17 00:00:00 2001 From: qianlong Date: Wed, 28 Jul 2021 20:15:53 +0800 Subject: [PATCH] watchdogtest: support build in kernel-5.10 Modify "defined" to "IS_ENABLED" fix build can't find CONFIG_QCOM_WDT_CORE. Change-Id: Ic489e3f0baab16c1b16cb662bda90b4513a63398 Signed-off-by: qianlong Reviewed-on: https://gerrit.mot.com/2026594 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhenxin Xi Submit-Approved: Jira Key --- drivers/watchdogtest/Makefile | 14 +++++++++----- drivers/watchdogtest/watchdogtest.c | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/watchdogtest/Makefile b/drivers/watchdogtest/Makefile index 34b09dd815a7..bfbdc14740ef 100644 --- a/drivers/watchdogtest/Makefile +++ b/drivers/watchdogtest/Makefile @@ -1,10 +1,14 @@ -KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build +all: modules -all: - $(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS) +modules: + $(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS) modules_install: - $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install + $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(M) modules_install + +%: + $(MAKE) -C $(KERNEL_SRC) M=$(M) $@ $(KBUILD_OPTIONS) clean: - $(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean \ No newline at end of file + rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers + rm -rf .tmp_versions diff --git a/drivers/watchdogtest/watchdogtest.c b/drivers/watchdogtest/watchdogtest.c index 50fc698e335e..edd5f62f3d47 100644 --- a/drivers/watchdogtest/watchdogtest.c +++ b/drivers/watchdogtest/watchdogtest.c @@ -75,9 +75,9 @@ static int watchdog_test_init(void) #if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) trigger_wdog_bite = (void *)kallsyms_lookup_name("msm_trigger_wdog_bite"); #else -#if defined(CONFIG_QCOM_WATCHDOG_V2) +#if IS_ENABLED(CONFIG_QCOM_WATCHDOG_V2) trigger_wdog_bite = msm_trigger_wdog_bite; -#elif defined(CONFIG_QCOM_WDT_CORE) +#elif IS_ENABLED(CONFIG_QCOM_WDT_CORE) trigger_wdog_bite = qcom_wdt_trigger_bite; #else trigger_wdog_bite = NULL;