Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-14 12:02:59 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-14 12:03:01 +0100
commit40262010d4bff21b4f5476fcab152ae69dfc54fb (patch)
treee120ff23008d548e1cd016b52e6e7763ccc3f389
parenta34e8dd3dfcf216bf5da1cd83a3912d7ef608437 (diff)
kgdboc: Fix warning with module build (bsc#1051510).
-rw-r--r--patches.fixes/kgdboc-Fix-warning-with-module-build.patch81
-rw-r--r--series.conf1
2 files changed, 82 insertions, 0 deletions
diff --git a/patches.fixes/kgdboc-Fix-warning-with-module-build.patch b/patches.fixes/kgdboc-Fix-warning-with-module-build.patch
new file mode 100644
index 0000000000..d51c59ab3d
--- /dev/null
+++ b/patches.fixes/kgdboc-Fix-warning-with-module-build.patch
@@ -0,0 +1,81 @@
+From 1cd25cbb2fedbc777f3a8c3cb1ba69b645aeaa64 Mon Sep 17 00:00:00 2001
+From: Laura Abbott <labbott@redhat.com>
+Date: Wed, 19 Sep 2018 18:59:01 -0700
+Subject: [PATCH] kgdboc: Fix warning with module build
+Git-commit: 1cd25cbb2fedbc777f3a8c3cb1ba69b645aeaa64
+Patch-mainline: v4.20-rc1
+References: bsc#1051510
+
+After 2dd453168643 ("kgdboc: Fix restrict error"), kgdboc_option_setup is
+now only used when built in, resulting in a warning when compiled as a
+Module:
+
+drivers/tty/serial/kgdboc.c:134:12: warning: 'kgdboc_option_setup' defined but not used [-Wunused-function]
+ static int kgdboc_option_setup(char *opt)
+ ^~~~~~~~~~~~~~~~~~~
+
+Move the function under the appropriate ifdef for builtin only.
+
+Fixes: 2dd453168643 ("kgdboc: Fix restrict error")
+Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
+Signed-off-by: Laura Abbott <labbott@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/tty/serial/kgdboc.c | 37 +++++++++++++++++++------------------
+ 1 file changed, 19 insertions(+), 18 deletions(-)
+
+--- a/drivers/tty/serial/kgdboc.c
++++ b/drivers/tty/serial/kgdboc.c
+@@ -131,24 +131,6 @@ static void kgdboc_unregister_kbd(void)
+ #define kgdboc_restore_input()
+ #endif /* ! CONFIG_KDB_KEYBOARD */
+
+-static int kgdboc_option_setup(char *opt)
+-{
+- if (!opt) {
+- pr_err("kgdboc: config string not provided\n");
+- return -EINVAL;
+- }
+-
+- if (strlen(opt) >= MAX_CONFIG_LEN) {
+- printk(KERN_ERR "kgdboc: config string too long\n");
+- return -ENOSPC;
+- }
+- strcpy(config, opt);
+-
+- return 0;
+-}
+-
+-__setup("kgdboc=", kgdboc_option_setup);
+-
+ static void cleanup_kgdboc(void)
+ {
+ if (kgdb_unregister_nmi_console())
+@@ -316,6 +298,25 @@ static struct kgdb_io kgdboc_io_ops = {
+ };
+
+ #ifdef CONFIG_KGDB_SERIAL_CONSOLE
++static int kgdboc_option_setup(char *opt)
++{
++ if (!opt) {
++ pr_err("config string not provided\n");
++ return -EINVAL;
++ }
++
++ if (strlen(opt) >= MAX_CONFIG_LEN) {
++ pr_err("config string too long\n");
++ return -ENOSPC;
++ }
++ strcpy(config, opt);
++
++ return 0;
++}
++
++__setup("kgdboc=", kgdboc_option_setup);
++
++
+ /* This is only available if kgdboc is a built in for early debugging */
+ static int __init kgdboc_early_init(char *opt)
+ {
diff --git a/series.conf b/series.conf
index 2b1c5197f6..e761fde15a 100644
--- a/series.conf
+++ b/series.conf
@@ -19345,6 +19345,7 @@
patches.fixes/kgdboc-Fix-restrict-error.patch
patches.drivers/serial-8250-Fix-clearing-FIFOs-in-RS485-mode-again.patch
patches.drivers/sc16is7xx-Fix-for-multi-channel-stall.patch
+ patches.fixes/kgdboc-Fix-warning-with-module-build.patch
patches.drivers/tty-wipe-buffer.patch
patches.drivers/tty-wipe-buffer-if-not-echoing-data.patch
patches.drivers/tty-check-name-length-in-tty_find_polling_driver.patch