target-core: don't use "const char*" for a buffer that is written to
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Tue, 21 Nov 2017 00:12:43 +0000 (01:12 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 12 Jan 2018 23:07:09 +0000 (15:07 -0800)
commit094bb5d766cfcdae47e332c6d6713c7029241be1
tree45cb641e8bf2701941c24499febbfad2fdb42100
parent30a7acd573899fd8b8ac39236eff6468b195ac7d
target-core: don't use "const char*" for a buffer that is written to

iscsi_parse_pr_out_transport_id launders the const away via a call to
strstr(), and then modifies the buffer (writing a nul byte) through
the return value. It's cleaner to be honest and simply declare the
parameter as "char*", fixing up the call chain, and allowing us to
drop the cast in the return statement.

Amusingly, the two current callers found it necessary to cast a
non-const pointer to a const.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_fabric_lib.c
drivers/target/target_core_internal.h
drivers/target/target_core_pr.c