From patchwork Wed Nov 15 00:57:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10058581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 31A396023A for ; Wed, 15 Nov 2017 01:03:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EC5529B90 for ; Wed, 15 Nov 2017 01:03:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1371129B94; Wed, 15 Nov 2017 01:03:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60ACE29B90 for ; Wed, 15 Nov 2017 01:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754173AbdKOBD4 (ORCPT ); Tue, 14 Nov 2017 20:03:56 -0500 Received: from rap-us.hgst.com ([199.255.44.250]:7904 "EHLO localhost" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753413AbdKOBDz (ORCPT ); Tue, 14 Nov 2017 20:03:55 -0500 X-Greylist: delayed 389 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Nov 2017 20:03:55 EST Received: by localhost (Postfix, from userid 1000) id C6AD2940848; Tue, 14 Nov 2017 16:57:21 -0800 (PST) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH 2/3] Constify scsi_dev_info_list_add_keyed() string arguments Date: Tue, 14 Nov 2017 16:57:20 -0800 Message-Id: <20171115005721.11023-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171115005721.11023-1-bart.vanassche@wdc.com> References: <20171115005721.11023-1-bart.vanassche@wdc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn --- drivers/scsi/scsi_devinfo.c | 9 +++++---- drivers/scsi/scsi_priv.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index e63873537139..d195560a641c 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c @@ -292,8 +292,8 @@ static struct scsi_dev_info_list_table *scsi_devinfo_lookup_by_key(int key) * scsi_strcpy_devinfo: called from scsi_dev_info_list_add to copy into * devinfo vendor and model strings. */ -static void scsi_strcpy_devinfo(char *name, char *to, size_t to_length, - char *from, int compatible) +static void scsi_strcpy_devinfo(const char *name, char *to, size_t to_length, + const char *from, int compatible) { size_t from_length; @@ -360,8 +360,9 @@ static int scsi_dev_info_list_add(int compatible, char *vendor, char *model, * * Returns: 0 OK, -error on failure. **/ -int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model, - char *strflags, int flags, int key) +int scsi_dev_info_list_add_keyed(int compatible, const char *vendor, + const char *model, const char *strflags, + int flags, int key) { struct scsi_dev_info_list *devinfo; struct scsi_dev_info_list_table *devinfo_table = diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index d79759271fe3..b82238577b19 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -58,8 +58,8 @@ extern int scsi_get_device_flags_keyed(struct scsi_device *sdev, const unsigned char *vendor, const unsigned char *model, int key, unsigned int *flags); -extern int scsi_dev_info_list_add_keyed(int compatible, char *vendor, - char *model, char *strflags, +extern int scsi_dev_info_list_add_keyed(int compatible, const char *vendor, + const char *model, const char *strflags, int flags, int key); extern int scsi_dev_info_list_del_keyed(char *vendor, char *model, int key); extern int scsi_dev_info_add_list(int key, const char *name);