Skip to content

Commit

Permalink
kgdboc: Fix restrict error
Browse files Browse the repository at this point in the history
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: Laura Abbott <labbott@redhat.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
labbott authored and gregkh committed Sep 18, 2018
1 parent 39724d5 commit 2dd4531
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/tty/serial/kgdboc.c
Expand Up @@ -162,15 +162,13 @@ static int configure_kgdboc(void)
{
struct tty_driver *p;
int tty_line = 0;
int err;
int err = -ENODEV;
char *cptr = config;
struct console *cons;

err = kgdboc_option_setup(config);
if (err || !strlen(config) || isspace(config[0]))
if (!strlen(config) || isspace(config[0]))
goto noconfig;

err = -ENODEV;
kgdboc_io_ops.is_console = 0;
kgdb_tty_driver = NULL;

Expand Down

0 comments on commit 2dd4531

Please sign in to comment.