OSDN Git Service

misc: kgdbts: Fix restrict error
authorLaura Abbott <labbott@redhat.com>
Tue, 11 Sep 2018 17:44:03 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Sep 2018 18:21:02 +0000 (20:21 +0200)
commitfa0218ef733e6f247a1a3986e3eb12460064ac77
tree1a9163c405afa30493594a01777628af53b86edd
parent85dc2c65e6c975baaf36ea30f2ccc0a36a8c8add
misc: kgdbts: Fix restrict error

kgdbts current fails when compiled with restrict:

drivers/misc/kgdbts.c: In function ‘configure_kgdbts’:
drivers/misc/kgdbts.c:1070:2: error: ‘strcpy’ source argument is the same as destination [-Werror=restrict]
  strcpy(config, opt);
  ^~~~~~~~~~~~~~~~~~~

As the error says, config is being used in both the source and destination.
Refactor the code to avoid the extra copy and put the parsing closer to
the actual location.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/kgdbts.c