From 3409f9ab71d7db96eed849f49a6c8116c62dc251 Mon Sep 17 00:00:00 2001 From: Aleksander Alekseev Date: Thu, 18 Aug 2016 12:36:53 +0300 Subject: [PATCH 01/21] kselftest: kselftest documentation improvement Suggested patch solves two issues: 1) Currently documentation is unclear whether `make kselftest` should be run before or after kernel was installed and booted. `make help` gives a clear answer on that: "kselftest - Build and run kernel selftest (run as root). Build, install, and boot kernel before running kselftest on it." 2) Documentation states that `make kselftest` executes "unit" tests. Technically it's not a _unit_ test if it requires to install an application first. It's either integration or system test. To not to confuse a user I suggest not to use a word "unit". Signed-off-by: Aleksander Alekseev Acked-by: Michael Ellerman Signed-off-by: Shuah Khan --- Documentation/kselftest.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt index 979eacae243d..54bee77fa728 100644 --- a/Documentation/kselftest.txt +++ b/Documentation/kselftest.txt @@ -1,8 +1,9 @@ Linux Kernel Selftests The kernel contains a set of "self tests" under the tools/testing/selftests/ -directory. These are intended to be small unit tests to exercise individual -code paths in the kernel. +directory. These are intended to be small tests to exercise individual code +paths in the kernel. Tests are intended to be run after building, installing +and booting a kernel. On some systems, hot-plug tests could hang forever waiting for cpu and memory to be ready to be offlined. A special hot-plug target is created From 0ad46becb5c03e7d2464f00b2a1cd460a9c2b3c0 Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Fri, 12 Aug 2016 22:49:59 +0200 Subject: [PATCH 02/21] selftests/zram: replace ZRAM_LZ4_COMPRESS Since commit ce1ed9f98e88 ("zram: delete custom lzo/lz4") we need CONFIG_CRYPTO_LZ4=y instead of CONFIG_ZRAM_LZ4_COMPRESS Signed-off-by: Fabian Frederick Signed-off-by: Shuah Khan --- tools/testing/selftests/zram/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/zram/README b/tools/testing/selftests/zram/README index eb17917c8a3a..7972cc512408 100644 --- a/tools/testing/selftests/zram/README +++ b/tools/testing/selftests/zram/README @@ -13,7 +13,7 @@ Statistics for individual zram devices are exported through sysfs nodes at Kconfig required: CONFIG_ZRAM=y -CONFIG_ZRAM_LZ4_COMPRESS=y +CONFIG_CRYPTO_LZ4=y CONFIG_ZPOOL=y CONFIG_ZSMALLOC=y From c3cb83560daae4c619d1034eb98c1a40ee896387 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Tue, 9 Aug 2016 12:11:26 +0200 Subject: [PATCH 03/21] selftests/timers: Add missing error code assignment before test In order to work, the 'err' return value has to be updated otherwise the test can never be true. Signed-off-by: Christophe JAILLET Acked-by: John Stultz Signed-off-by: Shuah Khan --- tools/testing/selftests/timers/posix_timers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c index 5a246a02dff3..15cf56d32155 100644 --- a/tools/testing/selftests/timers/posix_timers.c +++ b/tools/testing/selftests/timers/posix_timers.c @@ -122,7 +122,7 @@ static int check_itimer(int which) else if (which == ITIMER_REAL) idle_loop(); - gettimeofday(&end, NULL); + err = gettimeofday(&end, NULL); if (err < 0) { perror("Can't call gettimeofday()\n"); return -1; @@ -175,7 +175,7 @@ static int check_timer_create(int which) user_loop(); - gettimeofday(&end, NULL); + err = gettimeofday(&end, NULL); if (err < 0) { perror("Can't call gettimeofday()\n"); return -1; From 10924bc6448760b355492f05ea414a65d924a72c Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Tue, 13 Sep 2016 10:08:36 -0600 Subject: [PATCH 04/21] selftests: move dnotify_test from Documentation/filesystems Move dnotify_test.c, Makefile, and .gitignore from Documentation/filesystems to selftests/filesystems. Remove filesystems build target from Documentation/Makefile and update selftests/filesystems/Makefile to work under selftests. dnotify_test will not be run as part of selftests suite and will not be included in install targets. It can be built separately for now. Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/filesystems/Makefile | 5 ----- .../testing/selftests}/filesystems/.gitignore | 0 tools/testing/selftests/filesystems/Makefile | 7 +++++++ .../testing/selftests}/filesystems/dnotify_test.c | 0 5 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 Documentation/filesystems/Makefile rename {Documentation => tools/testing/selftests}/filesystems/.gitignore (100%) create mode 100644 tools/testing/selftests/filesystems/Makefile rename {Documentation => tools/testing/selftests}/filesystems/dnotify_test.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index de955e151af8..0473710c09d0 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,3 +1,3 @@ subdir-y := accounting auxdisplay blackfin \ - filesystems filesystems ia64 laptops mic misc-devices \ + ia64 laptops mic misc-devices \ networking pcmcia prctl ptp timers vDSO watchdog diff --git a/Documentation/filesystems/Makefile b/Documentation/filesystems/Makefile deleted file mode 100644 index 883010ce5e35..000000000000 --- a/Documentation/filesystems/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y := dnotify_test - -# Tell kbuild to always build the programs -always := $(hostprogs-y) diff --git a/Documentation/filesystems/.gitignore b/tools/testing/selftests/filesystems/.gitignore similarity index 100% rename from Documentation/filesystems/.gitignore rename to tools/testing/selftests/filesystems/.gitignore diff --git a/tools/testing/selftests/filesystems/Makefile b/tools/testing/selftests/filesystems/Makefile new file mode 100644 index 000000000000..0ab11307b414 --- /dev/null +++ b/tools/testing/selftests/filesystems/Makefile @@ -0,0 +1,7 @@ +TEST_PROGS := dnotify_test +all: $(TEST_PROGS) + +include ../lib.mk + +clean: + rm -fr $(TEST_PROGS) diff --git a/Documentation/filesystems/dnotify_test.c b/tools/testing/selftests/filesystems/dnotify_test.c similarity index 100% rename from Documentation/filesystems/dnotify_test.c rename to tools/testing/selftests/filesystems/dnotify_test.c From 92dd8dd4d07f170db0638a20a8db691262da4e5e Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Tue, 13 Sep 2016 11:13:46 -0600 Subject: [PATCH 05/21] selftests: move prctl tests from Documentation/prctl Move prctl tests from Documentation/prctl to selftests/prctl. Remove prctl from Makefile to move the test. Update prctl Makefile to work under selftests. prctl will not be run as part of selftests suite and will not be included in install targets. They can be built separately for now. Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/prctl/Makefile | 10 ---------- .../testing/selftests}/prctl/.gitignore | 0 tools/testing/selftests/prctl/Makefile | 15 +++++++++++++++ .../prctl/disable-tsc-ctxt-sw-stress-test.c | 0 .../prctl/disable-tsc-on-off-stress-test.c | 0 .../testing/selftests}/prctl/disable-tsc-test.c | 0 7 files changed, 16 insertions(+), 11 deletions(-) delete mode 100644 Documentation/prctl/Makefile rename {Documentation => tools/testing/selftests}/prctl/.gitignore (100%) create mode 100644 tools/testing/selftests/prctl/Makefile rename {Documentation => tools/testing/selftests}/prctl/disable-tsc-ctxt-sw-stress-test.c (100%) rename {Documentation => tools/testing/selftests}/prctl/disable-tsc-on-off-stress-test.c (100%) rename {Documentation => tools/testing/selftests}/prctl/disable-tsc-test.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 0473710c09d0..7a28f6c26755 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,3 +1,3 @@ subdir-y := accounting auxdisplay blackfin \ ia64 laptops mic misc-devices \ - networking pcmcia prctl ptp timers vDSO watchdog + networking pcmcia ptp timers vDSO watchdog diff --git a/Documentation/prctl/Makefile b/Documentation/prctl/Makefile deleted file mode 100644 index 44de3080c7f2..000000000000 --- a/Documentation/prctl/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -ifndef CROSS_COMPILE -# List of programs to build -hostprogs-$(CONFIG_X86) := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test disable-tsc-test -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS_disable-tsc-ctxt-sw-stress-test.o += -I$(objtree)/usr/include -HOSTCFLAGS_disable-tsc-on-off-stress-test.o += -I$(objtree)/usr/include -HOSTCFLAGS_disable-tsc-test.o += -I$(objtree)/usr/include -endif diff --git a/Documentation/prctl/.gitignore b/tools/testing/selftests/prctl/.gitignore similarity index 100% rename from Documentation/prctl/.gitignore rename to tools/testing/selftests/prctl/.gitignore diff --git a/tools/testing/selftests/prctl/Makefile b/tools/testing/selftests/prctl/Makefile new file mode 100644 index 000000000000..35aa1c8f2df2 --- /dev/null +++ b/tools/testing/selftests/prctl/Makefile @@ -0,0 +1,15 @@ +ifndef CROSS_COMPILE +uname_M := $(shell uname -m 2>/dev/null || echo not) +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) + +ifeq ($(ARCH),x86) +TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \ + disable-tsc-test +all: $(TEST_PROGS) + +include ../lib.mk + +clean: + rm -fr $(TEST_PROGS) +endif +endif diff --git a/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c b/tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c similarity index 100% rename from Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c rename to tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c diff --git a/Documentation/prctl/disable-tsc-on-off-stress-test.c b/tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c similarity index 100% rename from Documentation/prctl/disable-tsc-on-off-stress-test.c rename to tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c diff --git a/Documentation/prctl/disable-tsc-test.c b/tools/testing/selftests/prctl/disable-tsc-test.c similarity index 100% rename from Documentation/prctl/disable-tsc-test.c rename to tools/testing/selftests/prctl/disable-tsc-test.c From 8dbbf854202610a033a0788c33d8feb1548d3eeb Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Tue, 13 Sep 2016 11:30:03 -0600 Subject: [PATCH 06/21] selftests: move ptp tests from Documentation/ptp Remove ptp from Makefile to move the test to selftests. Update ptp Makefile to work under selftests. ptp will not be run as part of selftests suite and will not be included in install targets. They can be built separately for now. Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/ptp/Makefile | 8 -------- {Documentation => tools/testing/selftests}/ptp/.gitignore | 0 tools/testing/selftests/ptp/Makefile | 8 ++++++++ {Documentation => tools/testing/selftests}/ptp/testptp.c | 0 {Documentation => tools/testing/selftests}/ptp/testptp.mk | 0 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 Documentation/ptp/Makefile rename {Documentation => tools/testing/selftests}/ptp/.gitignore (100%) create mode 100644 tools/testing/selftests/ptp/Makefile rename {Documentation => tools/testing/selftests}/ptp/testptp.c (100%) rename {Documentation => tools/testing/selftests}/ptp/testptp.mk (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 7a28f6c26755..8cd6d1aaabfa 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,3 +1,3 @@ subdir-y := accounting auxdisplay blackfin \ ia64 laptops mic misc-devices \ - networking pcmcia ptp timers vDSO watchdog + networking pcmcia timers vDSO watchdog diff --git a/Documentation/ptp/Makefile b/Documentation/ptp/Makefile deleted file mode 100644 index 293d6c09a11f..000000000000 --- a/Documentation/ptp/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# List of programs to build -hostprogs-y := testptp - -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS_testptp.o += -I$(objtree)/usr/include -HOSTLOADLIBES_testptp := -lrt diff --git a/Documentation/ptp/.gitignore b/tools/testing/selftests/ptp/.gitignore similarity index 100% rename from Documentation/ptp/.gitignore rename to tools/testing/selftests/ptp/.gitignore diff --git a/tools/testing/selftests/ptp/Makefile b/tools/testing/selftests/ptp/Makefile new file mode 100644 index 000000000000..83dd42b2129e --- /dev/null +++ b/tools/testing/selftests/ptp/Makefile @@ -0,0 +1,8 @@ +TEST_PROGS := testptp +LDLIBS += -lrt +all: $(TEST_PROGS) + +include ../lib.mk + +clean: + rm -fr $(TEST_PROGS) diff --git a/Documentation/ptp/testptp.c b/tools/testing/selftests/ptp/testptp.c similarity index 100% rename from Documentation/ptp/testptp.c rename to tools/testing/selftests/ptp/testptp.c diff --git a/Documentation/ptp/testptp.mk b/tools/testing/selftests/ptp/testptp.mk similarity index 100% rename from Documentation/ptp/testptp.mk rename to tools/testing/selftests/ptp/testptp.mk From f9b6b0ef60349cf1747d8f366f23900671f888c5 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Tue, 13 Sep 2016 12:06:20 -0600 Subject: [PATCH 07/21] selftests: move vDSO tests from Documentation/vDSO Remove vDSO from Makefile to move the to selftests. Update vDSO Makefile to work under selftests. vDSO will not be run as part of selftests suite and will not be included in install targets. They can be built separately for now. Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/vDSO/Makefile | 17 ---------------- .../testing/selftests}/vDSO/.gitignore | 0 tools/testing/selftests/vDSO/Makefile | 20 +++++++++++++++++++ .../testing/selftests}/vDSO/parse_vdso.c | 0 .../vDSO/vdso_standalone_test_x86.c | 0 .../testing/selftests}/vDSO/vdso_test.c | 0 7 files changed, 21 insertions(+), 18 deletions(-) delete mode 100644 Documentation/vDSO/Makefile rename {Documentation => tools/testing/selftests}/vDSO/.gitignore (100%) create mode 100644 tools/testing/selftests/vDSO/Makefile rename {Documentation => tools/testing/selftests}/vDSO/parse_vdso.c (100%) rename {Documentation => tools/testing/selftests}/vDSO/vdso_standalone_test_x86.c (100%) rename {Documentation => tools/testing/selftests}/vDSO/vdso_test.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 8cd6d1aaabfa..085b917b4695 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,3 +1,3 @@ subdir-y := accounting auxdisplay blackfin \ ia64 laptops mic misc-devices \ - networking pcmcia timers vDSO watchdog + networking pcmcia timers watchdog diff --git a/Documentation/vDSO/Makefile b/Documentation/vDSO/Makefile deleted file mode 100644 index b12e98770e1f..000000000000 --- a/Documentation/vDSO/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -ifndef CROSS_COMPILE -# vdso_test won't build for glibc < 2.16, so disable it -# hostprogs-y := vdso_test -hostprogs-$(CONFIG_X86) := vdso_standalone_test_x86 -vdso_standalone_test_x86-objs := vdso_standalone_test_x86.o parse_vdso.o -vdso_test-objs := parse_vdso.o vdso_test.o - -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS := -I$(objtree)/usr/include -std=gnu99 -HOSTCFLAGS_vdso_standalone_test_x86.o := -fno-asynchronous-unwind-tables -fno-stack-protector -HOSTLOADLIBES_vdso_standalone_test_x86 := -nostdlib -ifeq ($(CONFIG_X86_32),y) -HOSTLOADLIBES_vdso_standalone_test_x86 += -lgcc_s -endif -endif diff --git a/Documentation/vDSO/.gitignore b/tools/testing/selftests/vDSO/.gitignore similarity index 100% rename from Documentation/vDSO/.gitignore rename to tools/testing/selftests/vDSO/.gitignore diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile new file mode 100644 index 000000000000..706b68b1c372 --- /dev/null +++ b/tools/testing/selftests/vDSO/Makefile @@ -0,0 +1,20 @@ +ifndef CROSS_COMPILE +CFLAGS := -std=gnu99 +CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector +ifeq ($(CONFIG_X86_32),y) +LDLIBS += -lgcc_s +endif + +TEST_PROGS := vdso_test vdso_standalone_test_x86 + +all: $(TEST_PROGS) +vdso_test: parse_vdso.c vdso_test.c +vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.c + $(CC) $(CFLAGS) $(CFLAGS_vdso_standalone_test_x86) \ + vdso_standalone_test_x86.c parse_vdso.c \ + -o vdso_standalone_test_x86 + +include ../lib.mk +clean: + rm -fr $(TEST_PROGS) +endif diff --git a/Documentation/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c similarity index 100% rename from Documentation/vDSO/parse_vdso.c rename to tools/testing/selftests/vDSO/parse_vdso.c diff --git a/Documentation/vDSO/vdso_standalone_test_x86.c b/tools/testing/selftests/vDSO/vdso_standalone_test_x86.c similarity index 100% rename from Documentation/vDSO/vdso_standalone_test_x86.c rename to tools/testing/selftests/vDSO/vdso_standalone_test_x86.c diff --git a/Documentation/vDSO/vdso_test.c b/tools/testing/selftests/vDSO/vdso_test.c similarity index 100% rename from Documentation/vDSO/vdso_test.c rename to tools/testing/selftests/vDSO/vdso_test.c From b6ebbac51bedf9e98e837688bc838f400196da5e Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Tue, 13 Sep 2016 12:52:24 -0600 Subject: [PATCH 08/21] selftests: move ia64 tests from Documentation/ia64 Remove ia64 from Makefile to move the test to selftests. Update ia64 Makefile to work under selftests. ia64 will not be run as part of selftests suite and will not be included in install targets. They can be built separately for now. The original Makefile built this test on all archirectures and this update doesn't change that. Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/ia64/Makefile | 5 ----- .../testing/selftests}/ia64/.gitignore | 0 tools/testing/selftests/ia64/Makefile | 8 ++++++++ .../testing/selftests}/ia64/aliasing-test.c | 0 5 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 Documentation/ia64/Makefile rename {Documentation => tools/testing/selftests}/ia64/.gitignore (100%) create mode 100644 tools/testing/selftests/ia64/Makefile rename {Documentation => tools/testing/selftests}/ia64/aliasing-test.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 085b917b4695..572e9b7f3758 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,3 +1,3 @@ subdir-y := accounting auxdisplay blackfin \ - ia64 laptops mic misc-devices \ + laptops mic misc-devices \ networking pcmcia timers watchdog diff --git a/Documentation/ia64/Makefile b/Documentation/ia64/Makefile deleted file mode 100644 index d493163affe7..000000000000 --- a/Documentation/ia64/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y := aliasing-test - -# Tell kbuild to always build the programs -always := $(hostprogs-y) diff --git a/Documentation/ia64/.gitignore b/tools/testing/selftests/ia64/.gitignore similarity index 100% rename from Documentation/ia64/.gitignore rename to tools/testing/selftests/ia64/.gitignore diff --git a/tools/testing/selftests/ia64/Makefile b/tools/testing/selftests/ia64/Makefile new file mode 100644 index 000000000000..2b3de2d3e945 --- /dev/null +++ b/tools/testing/selftests/ia64/Makefile @@ -0,0 +1,8 @@ +TEST_PROGS := aliasing-test + +all: $(TEST_PROGS) + +include ../lib.mk + +clean: + rm -fr $(TEST_PROGS) diff --git a/Documentation/ia64/aliasing-test.c b/tools/testing/selftests/ia64/aliasing-test.c similarity index 100% rename from Documentation/ia64/aliasing-test.c rename to tools/testing/selftests/ia64/aliasing-test.c From 02a35aad8a3e0b2bde1986053cefc2fcd63aee5d Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Tue, 13 Sep 2016 13:03:35 -0600 Subject: [PATCH 09/21] selftests: move watchdog tests from Documentation/watchdog Remove watchdog-test from Makefile to move the test to selftests. Add Makefile and .gitignore for watchdog-test. watchdog-test will not be run as part of selftests suite and will not be included in install targets. It can be built separately for now. Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/watchdog/src/.gitignore | 1 - Documentation/watchdog/src/Makefile | 2 +- tools/testing/selftests/watchdog/.gitignore | 1 + tools/testing/selftests/watchdog/Makefile | 8 ++++++++ .../testing/selftests/watchdog}/watchdog-test.c | 0 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/watchdog/.gitignore create mode 100644 tools/testing/selftests/watchdog/Makefile rename {Documentation/watchdog/src => tools/testing/selftests/watchdog}/watchdog-test.c (100%) diff --git a/Documentation/watchdog/src/.gitignore b/Documentation/watchdog/src/.gitignore index ac90997dba93..ff0ebb540333 100644 --- a/Documentation/watchdog/src/.gitignore +++ b/Documentation/watchdog/src/.gitignore @@ -1,2 +1 @@ watchdog-simple -watchdog-test diff --git a/Documentation/watchdog/src/Makefile b/Documentation/watchdog/src/Makefile index 4a892c304983..47be791827d4 100644 --- a/Documentation/watchdog/src/Makefile +++ b/Documentation/watchdog/src/Makefile @@ -1,5 +1,5 @@ # List of programs to build -hostprogs-y := watchdog-simple watchdog-test +hostprogs-y := watchdog-simple # Tell kbuild to always build the programs always := $(hostprogs-y) diff --git a/tools/testing/selftests/watchdog/.gitignore b/tools/testing/selftests/watchdog/.gitignore new file mode 100644 index 000000000000..5aac51575c7e --- /dev/null +++ b/tools/testing/selftests/watchdog/.gitignore @@ -0,0 +1 @@ +watchdog-test diff --git a/tools/testing/selftests/watchdog/Makefile b/tools/testing/selftests/watchdog/Makefile new file mode 100644 index 000000000000..f863c664e3d1 --- /dev/null +++ b/tools/testing/selftests/watchdog/Makefile @@ -0,0 +1,8 @@ +TEST_PROGS := watchdog-test + +all: $(TEST_PROGS) + +include ../lib.mk + +clean: + rm -fr $(TEST_PROGS) diff --git a/Documentation/watchdog/src/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c similarity index 100% rename from Documentation/watchdog/src/watchdog-test.c rename to tools/testing/selftests/watchdog/watchdog-test.c From 3d2c86e3057995270e08693231039d9d942871f0 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Thu, 15 Sep 2016 08:36:07 -0600 Subject: [PATCH 10/21] selftests: Move networking/timestamping from Documentation Remove networking from Documentation Makefile to move the test to selftests. Update networking/timestamping Makefile to work under selftests. These tests will not be run as part of selftests suite and will not be included in install targets. They can be built and run separately for now. This is part of the effort to move runnable code from Documentation. Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 3 +-- Documentation/networking/Makefile | 1 - Documentation/networking/timestamping/Makefile | 14 -------------- .../selftests}/networking/timestamping/.gitignore | 0 .../selftests/networking/timestamping/Makefile | 8 ++++++++ .../networking/timestamping/hwtstamp_config.c | 0 .../networking/timestamping/timestamping.c | 0 .../networking/timestamping/txtimestamp.c | 0 8 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 Documentation/networking/Makefile delete mode 100644 Documentation/networking/timestamping/Makefile rename {Documentation => tools/testing/selftests}/networking/timestamping/.gitignore (100%) create mode 100644 tools/testing/selftests/networking/timestamping/Makefile rename {Documentation => tools/testing/selftests}/networking/timestamping/hwtstamp_config.c (100%) rename {Documentation => tools/testing/selftests}/networking/timestamping/timestamping.c (100%) rename {Documentation => tools/testing/selftests}/networking/timestamping/txtimestamp.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 572e9b7f3758..f530c2980618 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,3 +1,2 @@ subdir-y := accounting auxdisplay blackfin \ - laptops mic misc-devices \ - networking pcmcia timers watchdog + laptops mic misc-devices pcmcia timers watchdog diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile deleted file mode 100644 index 4c5d7c485439..000000000000 --- a/Documentation/networking/Makefile +++ /dev/null @@ -1 +0,0 @@ -subdir-y := timestamping diff --git a/Documentation/networking/timestamping/Makefile b/Documentation/networking/timestamping/Makefile deleted file mode 100644 index 8c20dfaa4d6e..000000000000 --- a/Documentation/networking/timestamping/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# To compile, from the source root -# -# make headers_install -# make M=documentation - -# List of programs to build -hostprogs-y := hwtstamp_config timestamping txtimestamp - -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS_timestamping.o += -I$(objtree)/usr/include -HOSTCFLAGS_txtimestamp.o += -I$(objtree)/usr/include -HOSTCFLAGS_hwtstamp_config.o += -I$(objtree)/usr/include diff --git a/Documentation/networking/timestamping/.gitignore b/tools/testing/selftests/networking/timestamping/.gitignore similarity index 100% rename from Documentation/networking/timestamping/.gitignore rename to tools/testing/selftests/networking/timestamping/.gitignore diff --git a/tools/testing/selftests/networking/timestamping/Makefile b/tools/testing/selftests/networking/timestamping/Makefile new file mode 100644 index 000000000000..ccbb9edbbbb9 --- /dev/null +++ b/tools/testing/selftests/networking/timestamping/Makefile @@ -0,0 +1,8 @@ +TEST_PROGS := hwtstamp_config timestamping txtimestamp + +all: $(TEST_PROGS) + +include ../../lib.mk + +clean: + rm -fr $(TEST_PROGS) diff --git a/Documentation/networking/timestamping/hwtstamp_config.c b/tools/testing/selftests/networking/timestamping/hwtstamp_config.c similarity index 100% rename from Documentation/networking/timestamping/hwtstamp_config.c rename to tools/testing/selftests/networking/timestamping/hwtstamp_config.c diff --git a/Documentation/networking/timestamping/timestamping.c b/tools/testing/selftests/networking/timestamping/timestamping.c similarity index 100% rename from Documentation/networking/timestamping/timestamping.c rename to tools/testing/selftests/networking/timestamping/timestamping.c diff --git a/Documentation/networking/timestamping/txtimestamp.c b/tools/testing/selftests/networking/timestamping/txtimestamp.c similarity index 100% rename from Documentation/networking/timestamping/txtimestamp.c rename to tools/testing/selftests/networking/timestamping/txtimestamp.c From 6bee835dd54e279f3d3ae2eca92a9c394b4fd028 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Fri, 16 Sep 2016 15:53:52 -0600 Subject: [PATCH 11/21] samples: move mic/mpssd example code from Documentation Move mic/mpssd examples to samples and remove it from Documentation Makefile. Create a new Makefile to build mic/mpssd. It can be built from top level directory or from mic/mpssd directory: Run make -C samples/mic/mpssd or cd samples/mic/mpssd; make Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/mic/Makefile | 1 - Documentation/mic/mpssd/Makefile | 21 --------------- .../mic/mpssd/.gitignore | 0 samples/mic/mpssd/Makefile | 27 +++++++++++++++++++ {Documentation => samples}/mic/mpssd/micctrl | 0 {Documentation => samples}/mic/mpssd/mpss | 0 {Documentation => samples}/mic/mpssd/mpssd.c | 0 {Documentation => samples}/mic/mpssd/mpssd.h | 0 {Documentation => samples}/mic/mpssd/sysfs.c | 0 10 files changed, 28 insertions(+), 23 deletions(-) delete mode 100644 Documentation/mic/Makefile delete mode 100644 Documentation/mic/mpssd/Makefile rename {Documentation => samples}/mic/mpssd/.gitignore (100%) create mode 100644 samples/mic/mpssd/Makefile rename {Documentation => samples}/mic/mpssd/micctrl (100%) rename {Documentation => samples}/mic/mpssd/mpss (100%) rename {Documentation => samples}/mic/mpssd/mpssd.c (100%) rename {Documentation => samples}/mic/mpssd/mpssd.h (100%) rename {Documentation => samples}/mic/mpssd/sysfs.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index f530c2980618..80b5bdc65055 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1,2 @@ subdir-y := accounting auxdisplay blackfin \ - laptops mic misc-devices pcmcia timers watchdog + laptops misc-devices pcmcia timers watchdog diff --git a/Documentation/mic/Makefile b/Documentation/mic/Makefile deleted file mode 100644 index a191d453badf..000000000000 --- a/Documentation/mic/Makefile +++ /dev/null @@ -1 +0,0 @@ -subdir-y := mpssd diff --git a/Documentation/mic/mpssd/Makefile b/Documentation/mic/mpssd/Makefile deleted file mode 100644 index 06871b0c08a6..000000000000 --- a/Documentation/mic/mpssd/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -ifndef CROSS_COMPILE -# List of programs to build -hostprogs-$(CONFIG_X86_64) := mpssd - -mpssd-objs := mpssd.o sysfs.o - -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS += -I$(objtree)/usr/include -I$(srctree)/tools/include - -ifdef DEBUG -HOSTCFLAGS += -DDEBUG=$(DEBUG) -endif - -HOSTLOADLIBES_mpssd := -lpthread - -install: - install mpssd /usr/sbin/mpssd - install micctrl /usr/sbin/micctrl -endif diff --git a/Documentation/mic/mpssd/.gitignore b/samples/mic/mpssd/.gitignore similarity index 100% rename from Documentation/mic/mpssd/.gitignore rename to samples/mic/mpssd/.gitignore diff --git a/samples/mic/mpssd/Makefile b/samples/mic/mpssd/Makefile new file mode 100644 index 000000000000..3e3ef91fed6b --- /dev/null +++ b/samples/mic/mpssd/Makefile @@ -0,0 +1,27 @@ +ifndef CROSS_COMPILE +uname_M := $(shell uname -m 2>/dev/null || echo not) +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) + +ifeq ($(ARCH),x86) + +PROGS := mpssd +CC = $(CROSS_COMPILE)gcc +CFLAGS := -I../../../usr/include -I../../../tools/include + +ifdef DEBUG +CFLAGS += -DDEBUG=$(DEBUG) +endif + +all: $(PROGS) +mpssd: mpssd.c sysfs.c + $(CC) $(CFLAGS) mpssd.c sysfs.c -o mpssd -lpthread + +install: + install mpssd /usr/sbin/mpssd + install micctrl /usr/sbin/micctrl + +clean: + rm -fr $(PROGS) + +endif +endif diff --git a/Documentation/mic/mpssd/micctrl b/samples/mic/mpssd/micctrl similarity index 100% rename from Documentation/mic/mpssd/micctrl rename to samples/mic/mpssd/micctrl diff --git a/Documentation/mic/mpssd/mpss b/samples/mic/mpssd/mpss similarity index 100% rename from Documentation/mic/mpssd/mpss rename to samples/mic/mpssd/mpss diff --git a/Documentation/mic/mpssd/mpssd.c b/samples/mic/mpssd/mpssd.c similarity index 100% rename from Documentation/mic/mpssd/mpssd.c rename to samples/mic/mpssd/mpssd.c diff --git a/Documentation/mic/mpssd/mpssd.h b/samples/mic/mpssd/mpssd.h similarity index 100% rename from Documentation/mic/mpssd/mpssd.h rename to samples/mic/mpssd/mpssd.h diff --git a/Documentation/mic/mpssd/sysfs.c b/samples/mic/mpssd/sysfs.c similarity index 100% rename from Documentation/mic/mpssd/sysfs.c rename to samples/mic/mpssd/sysfs.c From 986b891ad121c61200d3dffcc8ed128a1397682e Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Fri, 16 Sep 2016 16:07:20 -0600 Subject: [PATCH 12/21] samples: move misc-devices/mei example code from Documentation Move misc-devices/mei examples to samples/mei and remove it from Documentation Makefile. Delete misc-devices/Makefile. Create a new Makefile to build samples/mei. It can be built from top level directory or from mei directory: Run make -C samples/mei or cd samples/mei; make Acked-by: Jonathan Corbet Acked-by: Greg Kroah-Hartman Acked-by: Tomas Winkler Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/misc-devices/Makefile | 1 - Documentation/misc-devices/mei/Makefile | 5 ----- MAINTAINERS | 1 + {Documentation/misc-devices => samples}/mei/.gitignore | 0 samples/mei/Makefile | 9 +++++++++ {Documentation/misc-devices => samples}/mei/TODO | 0 .../misc-devices => samples}/mei/mei-amt-version.c | 0 8 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 Documentation/misc-devices/Makefile delete mode 100644 Documentation/misc-devices/mei/Makefile rename {Documentation/misc-devices => samples}/mei/.gitignore (100%) create mode 100644 samples/mei/Makefile rename {Documentation/misc-devices => samples}/mei/TODO (100%) rename {Documentation/misc-devices => samples}/mei/mei-amt-version.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 80b5bdc65055..3c2a207a7c40 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1,2 @@ subdir-y := accounting auxdisplay blackfin \ - laptops misc-devices pcmcia timers watchdog + laptops pcmcia timers watchdog diff --git a/Documentation/misc-devices/Makefile b/Documentation/misc-devices/Makefile deleted file mode 100644 index e2b7aa4c9e21..000000000000 --- a/Documentation/misc-devices/Makefile +++ /dev/null @@ -1 +0,0 @@ -subdir-y := mei diff --git a/Documentation/misc-devices/mei/Makefile b/Documentation/misc-devices/mei/Makefile deleted file mode 100644 index d758047d1b6d..000000000000 --- a/Documentation/misc-devices/mei/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y := mei-amt-version -HOSTCFLAGS_mei-amt-version.o += -I$(objtree)/usr/include -# Tell kbuild to always build the programs -always := $(hostprogs-y) diff --git a/MAINTAINERS b/MAINTAINERS index 20bb1d00098c..b76872ace843 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6244,6 +6244,7 @@ F: include/linux/mei_cl_bus.h F: drivers/misc/mei/* F: drivers/watchdog/mei_wdt.c F: Documentation/misc-devices/mei/* +F: samples/mei/* INTEL MIC DRIVERS (mic) M: Sudeep Dutt diff --git a/Documentation/misc-devices/mei/.gitignore b/samples/mei/.gitignore similarity index 100% rename from Documentation/misc-devices/mei/.gitignore rename to samples/mei/.gitignore diff --git a/samples/mei/Makefile b/samples/mei/Makefile new file mode 100644 index 000000000000..7aac216dc420 --- /dev/null +++ b/samples/mei/Makefile @@ -0,0 +1,9 @@ +CC := $(CROSS_COMPILE)gcc +CFLAGS := -I../../usr/include + +PROGS := mei-amt-version + +all: $(PROGS) + +clean: + rm -fr $(PROGS) diff --git a/Documentation/misc-devices/mei/TODO b/samples/mei/TODO similarity index 100% rename from Documentation/misc-devices/mei/TODO rename to samples/mei/TODO diff --git a/Documentation/misc-devices/mei/mei-amt-version.c b/samples/mei/mei-amt-version.c similarity index 100% rename from Documentation/misc-devices/mei/mei-amt-version.c rename to samples/mei/mei-amt-version.c From 155fe001c6cd840c1cef3a8c42a8f14296a47c57 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Fri, 16 Sep 2016 17:20:42 -0600 Subject: [PATCH 13/21] samples: move timers example code from Documentation Move timers examples to samples and remove it from Documentation Makefile. Create a new Makefile to build timers. It can be built from top level directory or from timers directory: Run make -C samples/timers or cd samples/timers; make Acked-by: Jonathan Corbet Acked-by: Clemens Ladisch Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/timers/Makefile | 5 ----- Documentation/timers/hpet.txt | 2 +- {Documentation => samples}/timers/.gitignore | 0 samples/timers/Makefile | 15 +++++++++++++++ {Documentation => samples}/timers/hpet_example.c | 0 6 files changed, 17 insertions(+), 7 deletions(-) delete mode 100644 Documentation/timers/Makefile rename {Documentation => samples}/timers/.gitignore (100%) create mode 100644 samples/timers/Makefile rename {Documentation => samples}/timers/hpet_example.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 3c2a207a7c40..fc386b7a01b2 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1,2 @@ subdir-y := accounting auxdisplay blackfin \ - laptops pcmcia timers watchdog + laptops pcmcia watchdog diff --git a/Documentation/timers/Makefile b/Documentation/timers/Makefile deleted file mode 100644 index 6c09ee6ca721..000000000000 --- a/Documentation/timers/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-$(CONFIG_X86) := hpet_example - -# Tell kbuild to always build the programs -always := $(hostprogs-y) diff --git a/Documentation/timers/hpet.txt b/Documentation/timers/hpet.txt index a484d2c109d7..895345ec513b 100644 --- a/Documentation/timers/hpet.txt +++ b/Documentation/timers/hpet.txt @@ -25,4 +25,4 @@ arch/x86/kernel/hpet.c. The driver provides a userspace API which resembles the API found in the RTC driver framework. An example user space program is provided in -file:Documentation/timers/hpet_example.c +file:samples/timers/hpet_example.c diff --git a/Documentation/timers/.gitignore b/samples/timers/.gitignore similarity index 100% rename from Documentation/timers/.gitignore rename to samples/timers/.gitignore diff --git a/samples/timers/Makefile b/samples/timers/Makefile new file mode 100644 index 000000000000..a5c3c4a35ca1 --- /dev/null +++ b/samples/timers/Makefile @@ -0,0 +1,15 @@ +ifndef CROSS_COMPILE +uname_M := $(shell uname -m 2>/dev/null || echo not) +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) + +ifeq ($(ARCH),x86) +CC := $(CROSS_COMPILE)gcc +PROGS := hpet_example + +all: $(PROGS) + +clean: + rm -fr $(PROGS) + +endif +endif diff --git a/Documentation/timers/hpet_example.c b/samples/timers/hpet_example.c similarity index 100% rename from Documentation/timers/hpet_example.c rename to samples/timers/hpet_example.c From 071bf69a0220253a44acb8b2a27f7a262b9a46bf Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Fri, 16 Sep 2016 17:40:40 -0600 Subject: [PATCH 14/21] samples: move watchdog example code from Documentation Move watchdog examples to samples and remove it from Documentation Makefile. Create a new Makefile to build watchdog. It can be built from top level directory or from watchdog directory: Run make -C samples/watchdog or cd samples/watchdog; make Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/watchdog/Makefile | 1 - Documentation/watchdog/src/Makefile | 5 ----- Documentation/watchdog/watchdog-api.txt | 2 +- Documentation/watchdog/wdt.txt | 2 +- .../watchdog/src => samples/watchdog}/.gitignore | 0 samples/watchdog/Makefile | 8 ++++++++ .../watchdog/src => samples/watchdog}/watchdog-simple.c | 0 8 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 Documentation/watchdog/Makefile delete mode 100644 Documentation/watchdog/src/Makefile rename {Documentation/watchdog/src => samples/watchdog}/.gitignore (100%) create mode 100644 samples/watchdog/Makefile rename {Documentation/watchdog/src => samples/watchdog}/watchdog-simple.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index fc386b7a01b2..b2210b7af2e5 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1,2 @@ subdir-y := accounting auxdisplay blackfin \ - laptops pcmcia watchdog + laptops pcmcia diff --git a/Documentation/watchdog/Makefile b/Documentation/watchdog/Makefile deleted file mode 100644 index 6018f45f2471..000000000000 --- a/Documentation/watchdog/Makefile +++ /dev/null @@ -1 +0,0 @@ -subdir-y := src diff --git a/Documentation/watchdog/src/Makefile b/Documentation/watchdog/src/Makefile deleted file mode 100644 index 47be791827d4..000000000000 --- a/Documentation/watchdog/src/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y := watchdog-simple - -# Tell kbuild to always build the programs -always := $(hostprogs-y) diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt index b3a701f48118..0e62ba33b7fb 100644 --- a/Documentation/watchdog/watchdog-api.txt +++ b/Documentation/watchdog/watchdog-api.txt @@ -37,7 +37,7 @@ activates as soon as /dev/watchdog is opened and will reboot unless the watchdog is pinged within a certain time, this time is called the timeout or margin. The simplest way to ping the watchdog is to write some data to the device. So a very simple watchdog daemon would look -like this source file: see Documentation/watchdog/src/watchdog-simple.c +like this source file: see samples/watchdog/watchdog-simple.c A more advanced driver could for example check that a HTTP server is still responding before doing the write call to ping the watchdog. diff --git a/Documentation/watchdog/wdt.txt b/Documentation/watchdog/wdt.txt index 061c2e35384f..ed2f0b860869 100644 --- a/Documentation/watchdog/wdt.txt +++ b/Documentation/watchdog/wdt.txt @@ -47,4 +47,4 @@ The external event interfaces on the WDT boards are not currently supported. Minor numbers are however allocated for it. -Example Watchdog Driver: see Documentation/watchdog/src/watchdog-simple.c +Example Watchdog Driver: see samples/watchdog/watchdog-simple.c diff --git a/Documentation/watchdog/src/.gitignore b/samples/watchdog/.gitignore similarity index 100% rename from Documentation/watchdog/src/.gitignore rename to samples/watchdog/.gitignore diff --git a/samples/watchdog/Makefile b/samples/watchdog/Makefile new file mode 100644 index 000000000000..9b53d89b1ccf --- /dev/null +++ b/samples/watchdog/Makefile @@ -0,0 +1,8 @@ +CC := $(CROSS_COMPILE)gcc +PROGS := watchdog-simple + +all: $(PROGS) + +clean: + rm -fr $(PROGS) + diff --git a/Documentation/watchdog/src/watchdog-simple.c b/samples/watchdog/watchdog-simple.c similarity index 100% rename from Documentation/watchdog/src/watchdog-simple.c rename to samples/watchdog/watchdog-simple.c From 8fc07ebe63a40c312730da28e54dbb4fc6029ca3 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Fri, 16 Sep 2016 07:36:21 -0600 Subject: [PATCH 15/21] samples: move auxdisplay example code from Documentation Move auxdisplay examples to samples and remove it from Documentation Makefile. Create a new Makefile to build auxdisplay. It can be built from top level directory or from auxdisplay directory: Run make -C samples/auxdisplay or cd samples/auxdisplay; make Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/auxdisplay/Makefile | 7 ------- Documentation/auxdisplay/cfag12864b | 2 +- {Documentation => samples}/auxdisplay/.gitignore | 0 samples/auxdisplay/Makefile | 9 +++++++++ .../auxdisplay/cfag12864b-example.c | 0 6 files changed, 11 insertions(+), 9 deletions(-) delete mode 100644 Documentation/auxdisplay/Makefile rename {Documentation => samples}/auxdisplay/.gitignore (100%) create mode 100644 samples/auxdisplay/Makefile rename {Documentation => samples}/auxdisplay/cfag12864b-example.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index b2210b7af2e5..0b8cd503224c 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1,2 @@ -subdir-y := accounting auxdisplay blackfin \ +subdir-y := accounting blackfin \ laptops pcmcia diff --git a/Documentation/auxdisplay/Makefile b/Documentation/auxdisplay/Makefile deleted file mode 100644 index ada4dac99ef4..000000000000 --- a/Documentation/auxdisplay/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# List of programs to build -hostprogs-y := cfag12864b-example - -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS_cfag12864b-example.o += -I$(objtree)/usr/include diff --git a/Documentation/auxdisplay/cfag12864b b/Documentation/auxdisplay/cfag12864b index eb7be393a510..12fd51b8de75 100644 --- a/Documentation/auxdisplay/cfag12864b +++ b/Documentation/auxdisplay/cfag12864b @@ -101,5 +101,5 @@ Although the LCD won't get updated until the next refresh time arrives. Also, you can mmap the framebuffer: open & mmap, munmap & close... which is the best option for most uses. -Check Documentation/auxdisplay/cfag12864b-example.c +Check samples/auxdisplay/cfag12864b-example.c for a real working userspace complete program with usage examples. diff --git a/Documentation/auxdisplay/.gitignore b/samples/auxdisplay/.gitignore similarity index 100% rename from Documentation/auxdisplay/.gitignore rename to samples/auxdisplay/.gitignore diff --git a/samples/auxdisplay/Makefile b/samples/auxdisplay/Makefile new file mode 100644 index 000000000000..05e471feb6e5 --- /dev/null +++ b/samples/auxdisplay/Makefile @@ -0,0 +1,9 @@ +CC := $(CROSS_COMPILE)gcc +CFLAGS := -I../../usr/include + +PROGS := cfag12864b-example + +all: $(PROGS) + +clean: + rm -fr $(PROGS) diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/samples/auxdisplay/cfag12864b-example.c similarity index 100% rename from Documentation/auxdisplay/cfag12864b-example.c rename to samples/auxdisplay/cfag12864b-example.c From d522b2cdfed853e372d6b64a89d070368f0718f7 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Wed, 21 Sep 2016 16:19:35 -0600 Subject: [PATCH 16/21] tools: move accounting tool from Documentation Move accounting tool to tools and remove it from Documentation Makefile. Update location information for this tool. Create a new Makefile to build accounting. It can be built from top level directory or from accounting directory: Run make -C tools/accounting or cd tools/accounting; make Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/accounting/Makefile | 7 ------- Documentation/accounting/delay-accounting.txt | 6 +++--- {Documentation => tools}/accounting/.gitignore | 0 tools/accounting/Makefile | 9 +++++++++ {Documentation => tools}/accounting/getdelays.c | 0 6 files changed, 13 insertions(+), 11 deletions(-) delete mode 100644 Documentation/accounting/Makefile rename {Documentation => tools}/accounting/.gitignore (100%) create mode 100644 tools/accounting/Makefile rename {Documentation => tools}/accounting/getdelays.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 0b8cd503224c..e4dd5e4614a4 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1,2 @@ -subdir-y := accounting blackfin \ +subdir-y := blackfin \ laptops pcmcia diff --git a/Documentation/accounting/Makefile b/Documentation/accounting/Makefile deleted file mode 100644 index 7e232cb6fd7d..000000000000 --- a/Documentation/accounting/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# List of programs to build -hostprogs-y := getdelays - -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS_getdelays.o += -I$(objtree)/usr/include diff --git a/Documentation/accounting/delay-accounting.txt b/Documentation/accounting/delay-accounting.txt index 8a12f0730c94..042ea59b5853 100644 --- a/Documentation/accounting/delay-accounting.txt +++ b/Documentation/accounting/delay-accounting.txt @@ -54,9 +54,9 @@ are sent to userspace without requiring a command. If it is the last exiting task of a thread group, the per-tgid statistics are also sent. More details are given in the taskstats interface description. -The getdelays.c userspace utility in this directory allows simple commands to -be run and the corresponding delay statistics to be displayed. It also serves -as an example of using the taskstats interface. +The getdelays.c userspace utility in tools/accounting directory allows simple +commands to be run and the corresponding delay statistics to be displayed. It +also serves as an example of using the taskstats interface. Usage ----- diff --git a/Documentation/accounting/.gitignore b/tools/accounting/.gitignore similarity index 100% rename from Documentation/accounting/.gitignore rename to tools/accounting/.gitignore diff --git a/tools/accounting/Makefile b/tools/accounting/Makefile new file mode 100644 index 000000000000..647c94a219bf --- /dev/null +++ b/tools/accounting/Makefile @@ -0,0 +1,9 @@ +CC := $(CROSS_COMPILE)gcc +CFLAGS := -I../../usr/include + +PROGS := getdelays + +all: $(PROGS) + +clean: + rm -fr $(PROGS) diff --git a/Documentation/accounting/getdelays.c b/tools/accounting/getdelays.c similarity index 100% rename from Documentation/accounting/getdelays.c rename to tools/accounting/getdelays.c From 3ca9760fdfa411f7e5db54b3437fbb858d2ec825 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Wed, 21 Sep 2016 16:34:55 -0600 Subject: [PATCH 17/21] tools: move laptops dslm tool from Documentation Move laptops dslm tool to tools/laptop/dslm and remove it from Documentation Makefile. Update location information for this tool. Create a new Makefile to build dslm. It can be built from top level directory or from laptops directory: Run make -C tools/laptop/dslm or cd tools/laptop/dslm; make Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/laptops/00-INDEX | 4 ---- Documentation/laptops/Makefile | 5 ----- Documentation/laptops/laptop-mode.txt | 2 +- {Documentation/laptops => tools/laptop/dslm}/.gitignore | 0 tools/laptop/dslm/Makefile | 9 +++++++++ {Documentation/laptops => tools/laptop/dslm}/dslm.c | 0 7 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 Documentation/laptops/Makefile rename {Documentation/laptops => tools/laptop/dslm}/.gitignore (100%) create mode 100644 tools/laptop/dslm/Makefile rename {Documentation/laptops => tools/laptop/dslm}/dslm.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index e4dd5e4614a4..0ddb50c3cfc4 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1,2 @@ subdir-y := blackfin \ - laptops pcmcia + pcmcia diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-INDEX index 7c0ac2a26b9e..86169dc766f7 100644 --- a/Documentation/laptops/00-INDEX +++ b/Documentation/laptops/00-INDEX @@ -1,13 +1,9 @@ 00-INDEX - This file -Makefile - - Makefile for building dslm example program. asus-laptop.txt - information on the Asus Laptop Extras driver. disk-shock-protection.txt - information on hard disk shock protection. -dslm.c - - Simple Disk Sleep Monitor program laptop-mode.txt - how to conserve battery power using laptop-mode. sony-laptop.txt diff --git a/Documentation/laptops/Makefile b/Documentation/laptops/Makefile deleted file mode 100644 index 0abe44f68965..000000000000 --- a/Documentation/laptops/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y := dslm - -# Tell kbuild to always build the programs -always := $(hostprogs-y) diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt index 4ebbfc3f1c6e..19276f5d195c 100644 --- a/Documentation/laptops/laptop-mode.txt +++ b/Documentation/laptops/laptop-mode.txt @@ -779,4 +779,4 @@ Monitoring tool --------------- Bartek Kania submitted this, it can be used to measure how much time your disk -spends spun up/down. See Documentation/laptops/dslm.c +spends spun up/down. See tools/laptop/dslm/dslm.c diff --git a/Documentation/laptops/.gitignore b/tools/laptop/dslm/.gitignore similarity index 100% rename from Documentation/laptops/.gitignore rename to tools/laptop/dslm/.gitignore diff --git a/tools/laptop/dslm/Makefile b/tools/laptop/dslm/Makefile new file mode 100644 index 000000000000..ff613b31730b --- /dev/null +++ b/tools/laptop/dslm/Makefile @@ -0,0 +1,9 @@ +CC := $(CROSS_COMPILE)gcc +CFLAGS := -I../../usr/include + +PROGS := dslm + +all: $(PROGS) + +clean: + rm -fr $(PROGS) diff --git a/Documentation/laptops/dslm.c b/tools/laptop/dslm/dslm.c similarity index 100% rename from Documentation/laptops/dslm.c rename to tools/laptop/dslm/dslm.c From a67cd5482f37a255b9990ddb942aa7009dcba12f Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Wed, 21 Sep 2016 16:54:36 -0600 Subject: [PATCH 18/21] tools: move pcmcia crc32hash tool from Documentation Move pcmcia crc32hash tool from Documentation to tools/pcmcia and remove it from Documentation Makefile. Update location information for this tool. Create a new Makefile to build pcmcia. It can be built from top level directory or from pcmcia directory: Run make -C tools/pcmcia or cd tools/pcmcia; make Acked-by: Dominik Brodowski Acked-by: Greg Kroah-Hartman Acked-by: Jonathan Corbet Signed-off-by: Shuah Khan --- Documentation/Makefile | 3 +-- Documentation/pcmcia/Makefile | 7 ------- Documentation/pcmcia/devicetable.txt | 4 ++-- MAINTAINERS | 1 + {Documentation => tools}/pcmcia/.gitignore | 0 tools/pcmcia/Makefile | 9 +++++++++ {Documentation => tools}/pcmcia/crc32hash.c | 0 7 files changed, 13 insertions(+), 11 deletions(-) delete mode 100644 Documentation/pcmcia/Makefile rename {Documentation => tools}/pcmcia/.gitignore (100%) create mode 100644 tools/pcmcia/Makefile rename {Documentation => tools}/pcmcia/crc32hash.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 0ddb50c3cfc4..84359654cfcb 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,2 +1 @@ -subdir-y := blackfin \ - pcmcia +subdir-y := blackfin diff --git a/Documentation/pcmcia/Makefile b/Documentation/pcmcia/Makefile deleted file mode 100644 index 47a8fa162683..000000000000 --- a/Documentation/pcmcia/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# List of programs to build -hostprogs-y := crc32hash - -# Tell kbuild to always build the programs -always := $(hostprogs-y) - -HOSTCFLAGS_crc32hash.o += -I$(objtree)/usr/include diff --git a/Documentation/pcmcia/devicetable.txt b/Documentation/pcmcia/devicetable.txt index 199afd100cf2..5f3e00ab54c4 100644 --- a/Documentation/pcmcia/devicetable.txt +++ b/Documentation/pcmcia/devicetable.txt @@ -27,7 +27,7 @@ pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000 The hex value after "pa" is the hash of product ID string 1, after "pb" for string 2 and so on. -Alternatively, you can use crc32hash (see Documentation/pcmcia/crc32hash.c) +Alternatively, you can use crc32hash (see tools/pcmcia/crc32hash.c) to determine the crc32 hash. Simply pass the string you want to evaluate as argument to this program, e.g.: -$ ./crc32hash "Dual Speed" +$ tools/pcmcia/crc32hash "Dual Speed" diff --git a/MAINTAINERS b/MAINTAINERS index b76872ace843..01b13a5f331a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9106,6 +9106,7 @@ W: http://lists.infradead.org/mailman/listinfo/linux-pcmcia T: git git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia.git S: Maintained F: Documentation/pcmcia/ +F: tools/pcmcia/ F: drivers/pcmcia/ F: include/pcmcia/ diff --git a/Documentation/pcmcia/.gitignore b/tools/pcmcia/.gitignore similarity index 100% rename from Documentation/pcmcia/.gitignore rename to tools/pcmcia/.gitignore diff --git a/tools/pcmcia/Makefile b/tools/pcmcia/Makefile new file mode 100644 index 000000000000..81a7498c5cd9 --- /dev/null +++ b/tools/pcmcia/Makefile @@ -0,0 +1,9 @@ +CC := $(CROSS_COMPILE)gcc +CFLAGS := -I../../usr/include + +PROGS := crc32hash + +all: $(PROGS) + +clean: + rm -fr $(PROGS) diff --git a/Documentation/pcmcia/crc32hash.c b/tools/pcmcia/crc32hash.c similarity index 100% rename from Documentation/pcmcia/crc32hash.c rename to tools/pcmcia/crc32hash.c From 184892925118d924aa9304b466946ae18c029932 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Thu, 6 Oct 2016 16:00:50 -0600 Subject: [PATCH 19/21] samples: move blackfin gptimers-example from Documentation Move blackfin gptimers-example to samples and remove it from Documentation Makefile. Update samples Kconfig and Makefile to build gptimers-example. blackfin is the last CONFIG_BUILD_DOCSRC target in Documentation/Makefile. Hence this patch also includes changes to remove CONFIG_BUILD_DOCSRC from Makefile and lib/Kconfig.debug and updates VIDEO_PCI_SKELETON dependency on BUILD_DOCSRC. Documentation/Makefile is not deleted to avoid braking make htmldocs and make distclean. Acked-by: Michal Marek Acked-by: Jonathan Corbet Reviewed-by: Kees Cook Reported-by: Valentin Rothberg Reported-by: Paul Gortmaker Signed-off-by: Shuah Khan --- Documentation/Makefile | 2 +- Documentation/blackfin/00-INDEX | 4 ---- Documentation/blackfin/Makefile | 5 ----- Makefile | 3 --- drivers/media/v4l2-core/Kconfig | 2 +- lib/Kconfig.debug | 9 --------- samples/Kconfig | 6 ++++++ samples/Makefile | 2 +- samples/blackfin/Makefile | 1 + {Documentation => samples}/blackfin/gptimers-example.c | 0 10 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 Documentation/blackfin/Makefile create mode 100644 samples/blackfin/Makefile rename {Documentation => samples}/blackfin/gptimers-example.c (100%) diff --git a/Documentation/Makefile b/Documentation/Makefile index 84359654cfcb..c2a469112c37 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1 +1 @@ -subdir-y := blackfin +subdir-y := diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-INDEX index c54fcdd4ae9f..265a1effebde 100644 --- a/Documentation/blackfin/00-INDEX +++ b/Documentation/blackfin/00-INDEX @@ -1,10 +1,6 @@ 00-INDEX - This file -Makefile - - Makefile for gptimers example file. bfin-gpio-notes.txt - Notes in developing/using bfin-gpio driver. bfin-spi-notes.txt - Notes for using bfin spi bus driver. -gptimers-example.c - - gptimers example diff --git a/Documentation/blackfin/Makefile b/Documentation/blackfin/Makefile deleted file mode 100644 index 6782c58fbc29..000000000000 --- a/Documentation/blackfin/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(CONFIG_BLACKFIN),) -ifneq ($(CONFIG_BFIN_GPTIMERS),) -obj-m := gptimers-example.o -endif -endif diff --git a/Makefile b/Makefile index 70de1448c571..92b38ac151a2 100644 --- a/Makefile +++ b/Makefile @@ -933,9 +933,6 @@ vmlinux_prereq: $(vmlinux-deps) FORCE ifdef CONFIG_HEADERS_CHECK $(Q)$(MAKE) -f $(srctree)/Makefile headers_check endif -ifdef CONFIG_BUILD_DOCSRC - $(Q)$(MAKE) $(build)=Documentation -endif ifdef CONFIG_GDB_SCRIPTS $(Q)ln -fsn `cd $(srctree) && /bin/pwd`/scripts/gdb/vmlinux-gdb.py endif diff --git a/drivers/media/v4l2-core/Kconfig b/drivers/media/v4l2-core/Kconfig index 29b3436d0910..367523a3c774 100644 --- a/drivers/media/v4l2-core/Kconfig +++ b/drivers/media/v4l2-core/Kconfig @@ -27,7 +27,7 @@ config VIDEO_FIXED_MINOR_RANGES config VIDEO_PCI_SKELETON tristate "Skeleton PCI V4L2 driver" - depends on PCI && BUILD_DOCSRC + depends on PCI depends on VIDEO_V4L2 && VIDEOBUF2_CORE depends on VIDEOBUF2_MEMOPS && VIDEOBUF2_DMA_CONTIG ---help--- diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 2307d7c89dac..a6620838afc3 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1875,15 +1875,6 @@ config PROVIDE_OHCI1394_DMA_INIT See Documentation/debugging-via-ohci1394.txt for more information. -config BUILD_DOCSRC - bool "Build targets in Documentation/ tree" - depends on HEADERS_CHECK - help - This option attempts to build objects from the source files in the - kernel Documentation/ tree. - - Say N if you are unsure. - config DMA_API_DEBUG bool "Enable debugging of DMA-API usage" depends on HAVE_DMA_API_DEBUG diff --git a/samples/Kconfig b/samples/Kconfig index 85c405fcccb0..a6d2a43bbf2e 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -99,4 +99,10 @@ config SAMPLE_SECCOMP Build samples of seccomp filters using various methods of BPF filter construction. +config SAMPLE_BLACKFIN_GPTIMERS + tristate "Build blackfin gptimers sample code -- loadable modules only" + depends on BLACKFIN && BFIN_GPTIMERS && m + help + Build samples of blackfin gptimers sample module. + endif # SAMPLES diff --git a/samples/Makefile b/samples/Makefile index 1a20169d85ac..e17d66d77f09 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -2,4 +2,4 @@ obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \ hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \ - configfs/ connector/ v4l/ trace_printk/ + configfs/ connector/ v4l/ trace_printk/ blackfin/ diff --git a/samples/blackfin/Makefile b/samples/blackfin/Makefile new file mode 100644 index 000000000000..89b86cfd83a2 --- /dev/null +++ b/samples/blackfin/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_SAMPLE_BLACKFIN_GPTIMERS) += gptimers-example.o diff --git a/Documentation/blackfin/gptimers-example.c b/samples/blackfin/gptimers-example.c similarity index 100% rename from Documentation/blackfin/gptimers-example.c rename to samples/blackfin/gptimers-example.c From f59c668c0b898bbeba7179cd34e38a53e2f86c42 Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Thu, 6 Oct 2016 16:12:29 -0600 Subject: [PATCH 20/21] Doc: update 00-INDEX files to reflect the runnable code move Update 00-INDEX files with the current file list to reflect the runnable code move. Acked-by: Michal Marek Acked-by: Jonathan Corbet Reviewed-by: Kees Cook Signed-off-by: Shuah Khan --- Documentation/00-INDEX | 3 ++- Documentation/arm/00-INDEX | 2 -- Documentation/filesystems/00-INDEX | 2 -- Documentation/networking/00-INDEX | 2 -- Documentation/spi/00-INDEX | 2 -- Documentation/timers/00-INDEX | 4 ---- 6 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index cb9a6c6fa83b..3acc4f1a6f84 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX @@ -46,7 +46,8 @@ IRQ.txt Intel-IOMMU.txt - basic info on the Intel IOMMU virtualization support. Makefile - - some files in Documentation dir are actually sample code to build + - This file does nothing. Removing it breaks make htmldocs and + make distclean. ManagementStyle - how to (attempt to) manage kernel hackers. RCU/ diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX index dea011c8d7c7..b6e69fd371c4 100644 --- a/Documentation/arm/00-INDEX +++ b/Documentation/arm/00-INDEX @@ -8,8 +8,6 @@ Interrupts - ARM Interrupt subsystem documentation IXP4xx - Intel IXP4xx Network processor. -Makefile - - Build sourcefiles as part of the Documentation-build for arm Netwinder - Netwinder specific documentation Porting diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX index 9922939e7d99..f66e748fc5e4 100644 --- a/Documentation/filesystems/00-INDEX +++ b/Documentation/filesystems/00-INDEX @@ -2,8 +2,6 @@ - this file (info on some of the filesystems supported by linux). Locking - info on locking rules as they pertain to Linux VFS. -Makefile - - Makefile for building the filsystems-part of DocBook. 9p.txt - 9p (v9fs) is an implementation of the Plan 9 remote fs protocol. adfs.txt diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX index 415154a487d0..98f3d4b1bec9 100644 --- a/Documentation/networking/00-INDEX +++ b/Documentation/networking/00-INDEX @@ -10,8 +10,6 @@ LICENSE.qlge - GPLv2 for QLogic Linux qlge NIC Driver LICENSE.qlcnic - GPLv2 for QLogic Linux qlcnic NIC Driver -Makefile - - Makefile for docsrc. PLIP.txt - PLIP: The Parallel Line Internet Protocol device driver README.ipw2100 diff --git a/Documentation/spi/00-INDEX b/Documentation/spi/00-INDEX index 4644bf0d9832..8e4bb17d70eb 100644 --- a/Documentation/spi/00-INDEX +++ b/Documentation/spi/00-INDEX @@ -1,7 +1,5 @@ 00-INDEX - this file. -Makefile - - Makefile for the example sourcefiles. butterfly - AVR Butterfly SPI driver overview and pin configuration. ep93xx_spi diff --git a/Documentation/timers/00-INDEX b/Documentation/timers/00-INDEX index ee212a27772f..3be05fe0f1f9 100644 --- a/Documentation/timers/00-INDEX +++ b/Documentation/timers/00-INDEX @@ -4,12 +4,8 @@ highres.txt - High resolution timers and dynamic ticks design notes hpet.txt - High Precision Event Timer Driver for Linux -hpet_example.c - - sample hpet timer test program hrtimers.txt - subsystem for high-resolution kernel timers -Makefile - - Build and link hpet_example NO_HZ.txt - Summary of the different methods for the scheduler clock-interrupts management. timekeeping.txt From fecf861e765b2f9ce1a0487c3940afaed80ef7a8 Mon Sep 17 00:00:00 2001 From: SeongJae Park Date: Sun, 2 Oct 2016 11:02:18 +0900 Subject: [PATCH 21/21] selftests/futex: Check ANSI terminal color support Because test for color support of the running shell does not aware ANSI type terminals, it does not print colorful messages on some environemnt. This commit modifies the test to aware ANSI type terminal, too. Signed-off-by: SeongJae Park Acked-by: Darren Hart Signed-off-by: Shuah Khan --- tools/testing/selftests/futex/functional/run.sh | 2 +- tools/testing/selftests/futex/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/futex/functional/run.sh b/tools/testing/selftests/futex/functional/run.sh index e87dbe2a0b0d..7ff002eed624 100755 --- a/tools/testing/selftests/futex/functional/run.sh +++ b/tools/testing/selftests/futex/functional/run.sh @@ -24,7 +24,7 @@ # Test for a color capable console if [ -z "$USE_COLOR" ]; then - tput setf 7 + tput setf 7 || tput setaf 7 if [ $? -eq 0 ]; then USE_COLOR=1 tput sgr0 diff --git a/tools/testing/selftests/futex/run.sh b/tools/testing/selftests/futex/run.sh index 4126312ad64e..88bcb1767362 100755 --- a/tools/testing/selftests/futex/run.sh +++ b/tools/testing/selftests/futex/run.sh @@ -23,7 +23,7 @@ # Test for a color capable shell and pass the result to the subdir scripts USE_COLOR=0 -tput setf 7 +tput setf 7 || tput setaf 7 if [ $? -eq 0 ]; then USE_COLOR=1 tput sgr0