From patchwork Wed Nov 15 02:33:16 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: 10058611 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 EE7E66023A for ; Wed, 15 Nov 2017 02:35:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1708298D2 for ; Wed, 15 Nov 2017 02:35:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5BF6298DD; Wed, 15 Nov 2017 02:35:33 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 7DB4C298D2 for ; Wed, 15 Nov 2017 02:35:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754189AbdKOCfc (ORCPT ); Tue, 14 Nov 2017 21:35:32 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:42762 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751105AbdKOCf3 (ORCPT ); Tue, 14 Nov 2017 21:35:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1510713329; x=1542249329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Hi2w36qeaAgcigtJjoYZ3WSRmcO9G1a34WYKlVC1MU4=; b=h4fZDeXKygwf4j+jZF1eoLsCUfjP0XZvoKAhyl4VjaVxkXpDTshCkZS4 hZZ1ijN94g0y52ka8n2EEx0kD7wqMl+H6lcw+PNdI+pm5FaJNoTrsU1Ju NNesHLU89LZaw1+u9LEHR9C1vRcJy4lDPz8KoFQ5a1kmRsM+W2qJvGamN Pt0H1A8XCR08AW8tRMecXBk+V0r4G/2ZnaDa2wO5uLuG1EA5gNUMoD7DD kBMD8Cw+fiGd4n5UEc+v+F/TUUlixf2ML4Pgvrda3c3p+Z5sgHEPEEE+U 1l4bF3TAqZMt14wcnMWfkQtDKPGSASq7LPpRmEb5ZQ76LgrkneaD2Iuh8 A==; X-IronPort-AV: E=Sophos;i="5.44,397,1505750400"; d="scan'208";a="62471983" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 15 Nov 2017 10:35:29 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 14 Nov 2017 18:32:39 -0800 Received: from unknown (HELO MILHUBIP03.sdcorp.global.sandisk.com) ([10.177.9.96]) by uls-op-cesaip01.wdc.com with ESMTP; 14 Nov 2017 18:35:28 -0800 Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 14 Nov 2017 18:35:28 -0800 X-AuditID: 0ab10959-41c5898000002c97-af-5a0ba7efeac8 Received: from localhost.localdomain ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 76.43.11415.FE7AB0A5; Tue, 14 Nov 2017 18:35:27 -0800 (PST) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" CC: , 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 18:33:16 -0800 Message-ID: <20171115023317.3595-3-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171115023317.3595-1-bart.vanassche@wdc.com> References: <20171115023317.3595-1-bart.vanassche@wdc.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJMWRmVeSWpSXmKPExsXCtZEjRff9cu4og9PTbCwu/fnCaLHgzV42 i5WrjzJZrJqYZ/G4awarRff1HWwWy4//Y3Jg93hwaDOLx+6bDWweH5/eYvFYv+Uqi8fm09Ue nzfJebQf6GYKYI/isklJzcksSy3St0vgymidN5OlYL5QxZnTh5gbGLv5uxg5OSQETCQOTeln 72Lk4hASWMQosWzBB0aQBJuAnsSpefuYQGwRgVyJUw9vMIEUMQvsYpT4duw2WxcjB4ewgK/E wROSIDUsAqoSj1++AavnFbCSaL26gwVigbzE4u872UBsTgFriYl/9rOD2EJANW9Xf2OZwMi9 gJFhFaNYbmZOcW56ZoGhoV5xYl5KZnG2XnJ+7iZGcNhwRu5gfDrR/BAjEwenVAOj7IOTC2Lz WtkrtNibo/fbd/fImm1YIjzpq4hthn/1q1n3pYr9w9gUfHIkuTYJ+03nvbyj4ntS+7XWhq8J D3oeLrGPn1la1Xj0ykfz1i2Hm4QTxAIlfnDVbZulZ+mem7lJNn/+4kuT9Fqrn0w2V5Ww7/nJ vzhpkinvDr76M0+6FyWxx8vUaCqxFGckGmoxFxUnAgBOkjUnywEAAA== MIME-Version: 1.0 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);