From patchwork Wed Jan 20 19:41:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 8073921 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82F7ABEEE5 for ; Wed, 20 Jan 2016 19:43:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9360920531 for ; Wed, 20 Jan 2016 19:43:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B7A82057E for ; Wed, 20 Jan 2016 19:43:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754990AbcATTnW (ORCPT ); Wed, 20 Jan 2016 14:43:22 -0500 Received: from [216.241.235.118] ([216.241.235.118]:45689 "EHLO bby1mta03.pmc-sierra.bc.ca" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752027AbcATTnU (ORCPT ); Wed, 20 Jan 2016 14:43:20 -0500 Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 342A41070B43; Wed, 20 Jan 2016 11:42:59 -0800 (PST) Received: from bby1uinfra02-temp.pmc-sierra.bc.ca (bby1nis01 [216.241.226.203]) by bby1mta03.pmc-sierra.bc.ca (Postfix) with ESMTP id 0C1ED1070B3E; Wed, 20 Jan 2016 11:42:59 -0800 (PST) Received: from [127.0.1.1] (kirk.hou.lab.pmc-sierra.bc.ca [10.238.32.34]) by bby1uinfra02-temp.pmc-sierra.bc.ca (Postfix) with ESMTP id 76F91E0073; Wed, 20 Jan 2016 11:42:57 -0800 (PST) Subject: [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string From: Don Brace To: JBottomley@odin.com, Viswas.G@pmcs.com, scott.teel@pmcs.com, Kevin.Barnett@pmcs.com, scott.benesh@pmcs.com, Mahesh.Rajashekhara@pmcs.com, hch@infradead.org, Justin.Lindley@pmcs.com, elliott@hpe.com Cc: linux-scsi@vger.kernel.org Date: Wed, 20 Jan 2016 13:41:41 -0600 Message-ID: <20160120194141.23159.5168.stgit@brunhilda> In-Reply-To: <20160120194028.23159.25263.stgit@brunhilda> References: <20160120194028.23159.25263.stgit@brunhilda> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pmcs.com; h=subject:from:to:cc:date:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; s=default; bh=EJCxsZ06kpn5K9V0Jnn2wFBzHIUc6sW64iNkXFCqOEk=; b=PZNXufBh+yMnZEj0hkwkd6XcVOIOqgz0X7VFexeGw/J3Y/SozSjBZtg4XBt439WJmc5iH6h2maBYlYoFZazd7LqL1zh326365FeEJecJxSvgisA0K3Kot3p7Gh7BVVgSudLlgutyexef9bEt2FTO86ZKrkJZ8WwRKM5Dnz6qQ7s= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The hpsa driver uses this function to cleanup inquiry data. Our new pqi driver will also use this function. This function was copied into both drivers. This patch exports sanitize_inquiry_string so the hpsa and the pqi drivers can use this function directly. Hannes recommended the change in review: https://www.marc.info/?l=linux-scsi&m=144619249003064&w=2 that using the existing function in scsi_scan would be preferrable. Suggested-by: Hannes Reinecke Reviewed-by: Kevin Barnett Reviewed-by: Justin Lindley Reviewed-by: Scott Teel Reviewed-by: Hannes Reinecke Signed-off-by: Don Brace Reviewed-by: Matthew R. Ochs Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_scan.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 6a82066..1f02e84 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -518,7 +518,8 @@ void scsi_target_reap(struct scsi_target *starget) } /** - * sanitize_inquiry_string - remove non-graphical chars from an INQUIRY result string + * scsi_sanitize_inquiry_string - remove non-graphical chars from an + * INQUIRY result string * @s: INQUIRY result string to sanitize * @len: length of the string * @@ -531,7 +532,7 @@ void scsi_target_reap(struct scsi_target *starget) * string terminator, so all the following characters are set to * spaces. **/ -static void sanitize_inquiry_string(unsigned char *s, int len) +void scsi_sanitize_inquiry_string(unsigned char *s, int len) { int terminated = 0; @@ -542,6 +543,7 @@ static void sanitize_inquiry_string(unsigned char *s, int len) *s = ' '; } } +EXPORT_SYMBOL(scsi_sanitize_inquiry_string); /** * scsi_probe_lun - probe a single LUN using a SCSI INQUIRY @@ -627,9 +629,9 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, } if (result == 0) { - sanitize_inquiry_string(&inq_result[8], 8); - sanitize_inquiry_string(&inq_result[16], 16); - sanitize_inquiry_string(&inq_result[32], 4); + scsi_sanitize_inquiry_string(&inq_result[8], 8); + scsi_sanitize_inquiry_string(&inq_result[16], 16); + scsi_sanitize_inquiry_string(&inq_result[32], 4); response_len = inq_result[4] + 5; if (response_len > 255)