From: Arnd Bergmann <arnd@arndb.de>
To: Michal Marek <mmarek@suse.com>, Jonathan Corbet <corbet@lwn.net>,
Arnd Bergmann <arnd@arndb.de>,
Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Nicolas Pitre <nico@linaro.org>,
Rusty Russell <rusty@rustcorp.com.au>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] samples: connector: from Documentation to samples directory
Date: Mon, 25 Apr 2016 15:17:20 +0200 [thread overview]
Message-ID: <1461590265-1397577-2-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1461590265-1397577-1-git-send-email-arnd@arndb.de>
With the new autoksyms support, we can run into a situation where
the connector sample module is the only one using some exported
symbols that get dropped because they are never referenced by
the kernel otherwise, causing a build problem:
ERROR: "cn_del_callback" [Documentation/connector/cn_test.ko] undefined!
ERROR: "cn_add_callback" [Documentation/connector/cn_test.ko] undefined!
ERROR: "cn_netlink_send" [Documentation/connector/cn_test.ko] undefined!
Specifically, we do look in the samples directory for users of
symbols, but not the Documentation directory.
This solves the build problem by moving the connector sample into
the same directory as the other samples.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h")
---
Documentation/Makefile | 2 +-
Documentation/connector/connector.txt | 8 ++++++++
samples/Kconfig | 9 +++++++++
samples/Makefile | 2 +-
{Documentation => samples}/connector/.gitignore | 0
{Documentation => samples}/connector/Makefile | 6 +++---
{Documentation => samples}/connector/cn_test.c | 0
{Documentation => samples}/connector/ucon.c | 0
8 files changed, 22 insertions(+), 5 deletions(-)
rename {Documentation => samples}/connector/.gitignore (100%)
rename {Documentation => samples}/connector/Makefile (76%)
rename {Documentation => samples}/connector/cn_test.c (100%)
rename {Documentation => samples}/connector/ucon.c (100%)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 1207d7907650..13b5ae1b87aa 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,4 +1,4 @@
-subdir-y := accounting auxdisplay blackfin connector \
+subdir-y := accounting auxdisplay blackfin \
filesystems filesystems ia64 laptops mic misc-devices \
networking pcmcia prctl ptp timers vDSO video4linux \
watchdog
diff --git a/Documentation/connector/connector.txt b/Documentation/connector/connector.txt
index f6215f95149b..ab7ca897fab7 100644
--- a/Documentation/connector/connector.txt
+++ b/Documentation/connector/connector.txt
@@ -186,3 +186,11 @@ only cn_test.c test module used it.
Some work in netlink area is still being done, so things can be changed in
2.6.15 timeframe, if it will happen, documentation will be updated for that
kernel.
+
+/*****************************************/
+Code samples
+/*****************************************/
+
+Sample code for a connector test module and user space can be found
+in samples/connector/. To build this code, enable CONFIG_CONNECTOR
+and CONFIG_SAMPLES.
diff --git a/samples/Kconfig b/samples/Kconfig
index d54f28c6dc5e..559a58baff6e 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -76,4 +76,13 @@ config SAMPLE_CONFIGFS
help
Builds a sample configfs interface.
+config SAMPLE_CONNECTOR
+ tristate "Build connector sample -- loadable modules only"
+ depends on CONNECTOR && m
+ help
+ When enabled, this builds both a sample kernel module for
+ the connector interface and a user space tool to communicate
+ with it.
+ See also Documentation/connector/connector.txt
+
endif # SAMPLES
diff --git a/samples/Makefile b/samples/Makefile
index 48001d7e23f0..594ef7d9fa2a 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/
+ configfs/ connector/
diff --git a/Documentation/connector/.gitignore b/samples/connector/.gitignore
similarity index 100%
rename from Documentation/connector/.gitignore
rename to samples/connector/.gitignore
diff --git a/Documentation/connector/Makefile b/samples/connector/Makefile
similarity index 76%
rename from Documentation/connector/Makefile
rename to samples/connector/Makefile
index d98e4df98e24..04b9622b6f51 100644
--- a/Documentation/connector/Makefile
+++ b/samples/connector/Makefile
@@ -1,9 +1,9 @@
-ifneq ($(CONFIG_CONNECTOR),)
-obj-m += cn_test.o
-endif
+obj-$(CONFIG_SAMPLE_CONNECTOR) += cn_test.o
# List of programs to build
+ifdef CONFIG_SAMPLE_CONNECTOR
hostprogs-y := ucon
+endif
# Tell kbuild to always build the programs
always := $(hostprogs-y)
diff --git a/Documentation/connector/cn_test.c b/samples/connector/cn_test.c
similarity index 100%
rename from Documentation/connector/cn_test.c
rename to samples/connector/cn_test.c
diff --git a/Documentation/connector/ucon.c b/samples/connector/ucon.c
similarity index 100%
rename from Documentation/connector/ucon.c
rename to samples/connector/ucon.c
--
2.7.0
next prev parent reply other threads:[~2016-04-25 13:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 13:17 [PATCH 1/3] kbuild: call adjust_autoksyms.sh from source directory Arnd Bergmann
2016-04-25 13:17 ` Arnd Bergmann [this message]
2016-04-25 13:17 ` [PATCH 3/3] samples: v4l: from Documentation to samples directory Arnd Bergmann
2016-04-25 14:18 ` [PATCH 1/3] kbuild: call adjust_autoksyms.sh from source directory Nicolas Pitre
2016-04-25 15:20 ` Arnd Bergmann
2016-04-25 15:31 ` Nicolas Pitre
2016-04-25 16:03 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461590265-1397577-2-git-send-email-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.com \
--cc=nab@linux-iscsi.org \
--cc=nico@linaro.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®