linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build warning after merge of the tty tree
@ 2018-09-19  3:12 Stephen Rothwell
  2018-09-20  1:59 ` [PATCH] kgdboc: Fix warning with module build Laura Abbott
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2018-09-19  3:12 UTC (permalink / raw)
  To: Greg KH
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Laura Abbott,
	Daniel Thompson

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

Hi Greg,

After merging the tty tree, today's linux-next build (x86_64 allmodconfig)
produced this warning:

drivers/tty/serial/kgdboc.c:134:12: warning: 'kgdboc_option_setup' defined but not used [-Wunused-function]
 static int kgdboc_option_setup(char *opt)
            ^~~~~~~~~~~~~~~~~~~

Introduced by commit

  2dd453168643 ("kgdboc: Fix restrict error")

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] kgdboc: Fix warning with module build
  2018-09-19  3:12 linux-next: build warning after merge of the tty tree Stephen Rothwell
@ 2018-09-20  1:59 ` Laura Abbott
  2018-09-20  7:16   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Laura Abbott @ 2018-09-20  1:59 UTC (permalink / raw)
  To: Daniel Thompson, Greg Kroah-Hartman
  Cc: Laura Abbott, linux-next, linux-kernel, Stephen Rothwell


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")
Signed-off-by: Laura Abbott <labbott@redhat.com>
---
 drivers/tty/serial/kgdboc.c | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
index e9a83bb5bee5..baeeeaec3f03 100644
--- 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("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);
-
 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)
 {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kgdboc: Fix warning with module build
  2018-09-20  1:59 ` [PATCH] kgdboc: Fix warning with module build Laura Abbott
@ 2018-09-20  7:16   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-09-20  7:16 UTC (permalink / raw)
  To: Laura Abbott; +Cc: Daniel Thompson, linux-next, linux-kernel, Stephen Rothwell

On Wed, Sep 19, 2018 at 06:59:01PM -0700, Laura Abbott wrote:
> 
> 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")
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
>  drivers/tty/serial/kgdboc.c | 37 +++++++++++++++++++------------------
>  1 file changed, 19 insertions(+), 18 deletions(-)

You forgot a reported-by: tag :(

I'll go fix it up, thanks for the patch resolving this.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-20  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19  3:12 linux-next: build warning after merge of the tty tree Stephen Rothwell
2018-09-20  1:59 ` [PATCH] kgdboc: Fix warning with module build Laura Abbott
2018-09-20  7:16   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).