Commit ed74d1dd authored by Zhang Jian's avatar Zhang Jian Committed by Zheng Zengkai
Browse files

mm: init: Fix build waring for ascend enable features

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I66EW4


CVE: NA

----------------------------------------------------

When enable Ascend enable CONFIG_ASCEND_FEATURES, and enable
CONFIG_ASCEND_CHARGE_MIGRATE_HUGEPAGES, and build kernel image,
it will have build warning as follows:

arch/arm64/mm/init.c:736:2: warning: ISO C90 fobids mixed
declarations and code [-Wdeclaration-atfer-statement]
  736 | extern int enable_charge_mighp;

Signed-off-by: default avatarZhang Jian <zhangjian210@huawei.com>
Reviewed-by: default avatarchenweilong <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent fb2b7765
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -727,14 +727,20 @@ void dump_mem_limit(void)
	}
}

#ifdef CONFIG_ASCEND_CHARGE_MIGRATE_HUGEPAGES
extern int enable_charge_mighp;
#endif

#ifdef CONFIG_ARM64_PSEUDO_NMI
extern bool enable_pseudo_nmi;
#endif

void ascend_enable_all_features(void)
{
	if (IS_ENABLED(CONFIG_ASCEND_DVPP_MMAP))
		enable_mmap_dvpp = 1;

#ifdef CONFIG_ASCEND_CHARGE_MIGRATE_HUGEPAGES
	extern int enable_charge_mighp;

	enable_charge_mighp = 1;
#endif

@@ -743,8 +749,6 @@ void ascend_enable_all_features(void)
#endif

#ifdef CONFIG_ARM64_PSEUDO_NMI
	extern bool enable_pseudo_nmi;

	enable_pseudo_nmi = true;
#endif