提交 2dd45316 编写于 作者: L Laura Abbott 提交者: Greg Kroah-Hartman

kgdboc: Fix restrict error

There's an error when compiled with restrict:

drivers/tty/serial/kgdboc.c: In function ‘configure_kgdboc’:
drivers/tty/serial/kgdboc.c:137:2: error: ‘strcpy’ source argument is the same
as destination [-Werror=restrict]
  strcpy(config, opt);
  ^~~~~~~~~~~~~~~~~~~

As the error implies, this is from trying to use config as both source and
destination. Drop the call to the function where config is the argument
since nothing else happens in the function.
Signed-off-by: NLaura Abbott <labbott@redhat.com>
Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 39724d56
...@@ -162,15 +162,13 @@ static int configure_kgdboc(void) ...@@ -162,15 +162,13 @@ static int configure_kgdboc(void)
{ {
struct tty_driver *p; struct tty_driver *p;
int tty_line = 0; int tty_line = 0;
int err; int err = -ENODEV;
char *cptr = config; char *cptr = config;
struct console *cons; struct console *cons;
err = kgdboc_option_setup(config); if (!strlen(config) || isspace(config[0]))
if (err || !strlen(config) || isspace(config[0]))
goto noconfig; goto noconfig;
err = -ENODEV;
kgdboc_io_ops.is_console = 0; kgdboc_io_ops.is_console = 0;
kgdb_tty_driver = NULL; kgdb_tty_driver = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册