Skip to content

Commit 1106777

Browse files
committed
hugemmap15: Use TST_TEST_TCONF() for unsupported archs
15625f6 broke LTP build at least on riscv32 and mipsel32 (and for any new arch in the future). Replace #error directive with TST_TEST_TCONF() fixes that. Fixes: 15625f6 ("Hugetlb: Migrating libhugetlbfs icache-hygiene") Reviewed-by: Cyril Hrubis <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent 982a13d commit 1106777

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: LGPL-2.1-or-later
22
/*
33
* Copyright (C) 2005-2006 David Gibson & Adam Litke, IBM Corporation.
4+
* Copyright (c) Linux Test Project, 2022-2023
45
* Author: David Gibson & Adam Litke
56
*/
67

@@ -19,6 +20,13 @@
1920
*/
2021

2122
#define _GNU_SOURCE
23+
#include "hugetlb.h"
24+
25+
#if defined(__powerpc__) || defined(__powerpc64__) || defined(__ia64__) || \
26+
defined(__s390__) || defined(__s390x__) || defined(__sparc__) || \
27+
defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || \
28+
defined(__i386__) || defined(__x86_64__) || defined(__arm__)
29+
2230
#include <stdio.h>
2331
#include <stdlib.h>
2432
#include <setjmp.h>
@@ -30,8 +38,6 @@
3038
#include <sys/param.h>
3139
#include <sys/types.h>
3240

33-
#include "hugetlb.h"
34-
3541
#define SUCC_JMP 1
3642
#define FAIL_JMP 2
3743
#define COPY_SIZE 128
@@ -142,8 +148,6 @@ static void sig_handler(int signum, siginfo_t *si, void *uc)
142148
siglongjmp(sig_escape, FAIL_JMP + SIGSEGV);
143149
}
144150
#endif
145-
#else
146-
#error "Need to setup signal conditions for this arch"
147151
#endif
148152
}
149153

@@ -241,3 +245,6 @@ static struct tst_test test = {
241245
.test_all = run_test,
242246
.hugepages = {3, TST_NEEDS},
243247
};
248+
#else
249+
TST_TEST_TCONF("Signal handler for this architecture hasn't been written");
250+
#endif

0 commit comments

Comments
 (0)