Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965452AbeALXIE (ORCPT + 1 other); Fri, 12 Jan 2018 18:08:04 -0500 Received: from mail.linux-iscsi.org ([67.23.28.174]:50656 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965296AbeALXID (ORCPT ); Fri, 12 Jan 2018 18:08:03 -0500 Message-ID: <1515798480.21541.8.camel@haakon3.daterainc.com> Subject: Re: [PATCH] target-core: don't use "const char*" for a buffer that is written to From: "Nicholas A. Bellinger" To: Rasmus Villemoes Cc: Rasmus Villemoes , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 12 Jan 2018 15:08:00 -0800 In-Reply-To: <20171121001244.8026-1-linux@rasmusvillemoes.dk> References: <20171121001244.8026-1-linux@rasmusvillemoes.dk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Rasmus, Apologies for the delayed follow-up on this. On Tue, 2017-11-21 at 01:12 +0100, Rasmus Villemoes wrote: > From: Rasmus Villemoes > > 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 > --- > drivers/target/target_core_fabric_lib.c | 6 +++--- > drivers/target/target_core_internal.h | 2 +- > drivers/target/target_core_pr.c | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > Looks fine. Applied. Thank you.