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>
Wed, 20 Nov 2019 17:00:39 +0000 (18:00 +0100)
commit0038e0fca9dc59569be43db00db659d6066831cc
treed0ed19ff7ce1cb7f4cf14b3b44d49f509e9db898
parent3cd8af57e0f57098c340657f6870f5614c1230c7
misc: kgdbts: Fix restrict error

[ Upstream commit fa0218ef733e6f247a1a3986e3eb12460064ac77 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/kgdbts.c