From patchwork Thu Oct 12 09:11:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 10001269 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 8337160230 for ; Thu, 12 Oct 2017 09:11:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B6028D35 for ; Thu, 12 Oct 2017 09:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B60128D38; Thu, 12 Oct 2017 09:11:45 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 E1C5428D35 for ; Thu, 12 Oct 2017 09:11:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754494AbdJLJLc (ORCPT ); Thu, 12 Oct 2017 05:11:32 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37370 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750774AbdJLJLb (ORCPT ); Thu, 12 Oct 2017 05:11:31 -0400 Received: by mail-wm0-f65.google.com with SMTP id r68so3580953wmr.4; Thu, 12 Oct 2017 02:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=eG0INBC69SEQqGW9RIEdHP+bBVkRv5ttlEiEvMnnOAo=; b=hMI/ULeD9UorBoVEzNx+K7AVRaU/h9/1zmh5iWLENSesnOi0Yf6or+BW4O8xPaB1v/ 4WPEk4AO8KUwnebULTM8waIl7gSmd55KrY06Cugw2m08DA276pvaaZ5oEHqBR88pppGM +sCFlNgx15D5FlEIS4UqM1FxDMaAmF+Mgo6UDRUPd7v85RW8qnXi+tFUglG0tlQNqLiz hQMhDVGeEhqIufB5A33l9jzgyndHBYT9K07ElWFgfmFExIFtfUXljhOWK3XxMBYPBRD0 XjUKUQKwnieYXawFmFGJUxeQgTAo+1GdII29lbt4m2DylPX7opruFRiP0VqcxMVvOauh 8bOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eG0INBC69SEQqGW9RIEdHP+bBVkRv5ttlEiEvMnnOAo=; b=cj0TqsuW90evdReU6Cp9oqiN4vog1jUEfOESFeQe3z+SqtDqI39MpLg45Jeidh3IAg /BQjpSbzjszPK8iiXiLFzrnI+vB+7jruUO8P7J6nVjp6Bcd/wOgK1mWe9cILqo6R213B RwBgztj4+USU2KN6Rp3L3Joaqbntty8LH/uGxnSe7qxCvjEaXQV2tFl4G+RMWOH4/Fxw AYPqZseWQxnEE5lfllOUJzCYxmka9FcP5ooG1tlHOskY/24GvaSBKOiSVTzer115zbGm GUcF2ANaA3fCCeFrozpLnd1XrjTLqwpzsIpz3/B4d66LJOalEZNVUy5125mTOnJOGTFU 3TMw== X-Gm-Message-State: AMCzsaWo911/oHJVP+b5l5n2UerMVuc1XIF9l8/m8irrxSm1sIfDArGC G92+XEkNnsQ/mQRsyUDe9w4= X-Google-Smtp-Source: AOwi7QA+EunfyCDIpVn2HLd3K6Hozima/pfWSB+tB+ZtZeCwCc9iYZ8zCT9RExNga6ElCd+ZgcfW2Q== X-Received: by 10.223.131.4 with SMTP id 4mr1601525wrd.106.1507799489596; Thu, 12 Oct 2017 02:11:29 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id 56sm9031211wrx.2.2017.10.12.02.11.27 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 12 Oct 2017 02:11:28 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Thu, 12 Oct 2017 11:11:27 +0200 From: Bhumika Goyal To: julia.lawall@lip6.fr, nab@linux-iscsi.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] target: make config_item_type const Date: Thu, 12 Oct 2017 11:11:20 +0200 Message-Id: <1507799480-25286-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 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 is a followup patch for: https://lkml.org/lkml/2017/10/11/375 and https://patchwork.kernel.org/patch/9999649/ Make these structures const as they are either passed to the functions having the argument as const or stored as a reference in the "ci_type" const field of a config_item structure. Done using Coccinelle. Signed-off-by: Bhumika Goyal --- drivers/target/target_core_configfs.c | 14 +++++++------- drivers/target/target_core_stat.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 7e87d95..bd87cc2 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -307,7 +307,7 @@ static void target_core_deregister_fabric( /* * Provides Fabrics Groups and Item Attributes for /sys/kernel/config/target/ */ -static struct config_item_type target_core_fabrics_item = { +static const struct config_item_type target_core_fabrics_item = { .ct_group_ops = &target_core_fabric_group_ops, .ct_attrs = target_core_fabric_item_attrs, .ct_owner = THIS_MODULE, @@ -2376,7 +2376,7 @@ static void target_core_alua_lu_gp_release(struct config_item *item) .release = target_core_alua_lu_gp_release, }; -static struct config_item_type target_core_alua_lu_gp_cit = { +static const struct config_item_type target_core_alua_lu_gp_cit = { .ct_item_ops = &target_core_alua_lu_gp_ops, .ct_attrs = target_core_alua_lu_gp_attrs, .ct_owner = THIS_MODULE, @@ -2434,7 +2434,7 @@ static void target_core_alua_drop_lu_gp( .drop_item = &target_core_alua_drop_lu_gp, }; -static struct config_item_type target_core_alua_lu_gps_cit = { +static const struct config_item_type target_core_alua_lu_gps_cit = { .ct_item_ops = NULL, .ct_group_ops = &target_core_alua_lu_gps_group_ops, .ct_owner = THIS_MODULE, @@ -2813,7 +2813,7 @@ static void target_core_alua_tg_pt_gp_release(struct config_item *item) .release = target_core_alua_tg_pt_gp_release, }; -static struct config_item_type target_core_alua_tg_pt_gp_cit = { +static const struct config_item_type target_core_alua_tg_pt_gp_cit = { .ct_item_ops = &target_core_alua_tg_pt_gp_ops, .ct_attrs = target_core_alua_tg_pt_gp_attrs, .ct_owner = THIS_MODULE, @@ -2884,7 +2884,7 @@ static void target_core_alua_drop_tg_pt_gp( * core/alua/lu_gps and core/alua/tg_pt_gps that are attached to * target_core_alua_cit in target_core_init_configfs() below. */ -static struct config_item_type target_core_alua_cit = { +static const struct config_item_type target_core_alua_cit = { .ct_item_ops = NULL, .ct_attrs = NULL, .ct_owner = THIS_MODULE, @@ -3105,7 +3105,7 @@ static void target_core_hba_release(struct config_item *item) .release = target_core_hba_release, }; -static struct config_item_type target_core_hba_cit = { +static const struct config_item_type target_core_hba_cit = { .ct_item_ops = &target_core_hba_item_ops, .ct_group_ops = &target_core_hba_group_ops, .ct_attrs = target_core_hba_attrs, @@ -3188,7 +3188,7 @@ static void target_core_call_delhbafromtarget( .drop_item = target_core_call_delhbafromtarget, }; -static struct config_item_type target_core_cit = { +static const struct config_item_type target_core_cit = { .ct_item_ops = NULL, .ct_group_ops = &target_core_group_ops, .ct_attrs = NULL, diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c index 8038255..f0db91e 100644 --- a/drivers/target/target_core_stat.c +++ b/drivers/target/target_core_stat.c @@ -96,7 +96,7 @@ static ssize_t target_stat_ports_show(struct config_item *item, char *page) NULL, }; -static struct config_item_type target_stat_scsi_dev_cit = { +static const struct config_item_type target_stat_scsi_dev_cit = { .ct_attrs = target_stat_scsi_dev_attrs, .ct_owner = THIS_MODULE, }; @@ -193,7 +193,7 @@ static ssize_t target_stat_tgt_aborts_no_task_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_tgt_dev_cit = { +static const struct config_item_type target_stat_scsi_tgt_dev_cit = { .ct_attrs = target_stat_scsi_tgt_dev_attrs, .ct_owner = THIS_MODULE, }; @@ -414,7 +414,7 @@ static ssize_t target_stat_lu_creation_time_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_lu_cit = { +static const struct config_item_type target_stat_scsi_lu_cit = { .ct_attrs = target_stat_scsi_lu_attrs, .ct_owner = THIS_MODULE, }; @@ -540,7 +540,7 @@ static ssize_t target_stat_port_busy_count_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_port_cit = { +static const struct config_item_type target_stat_scsi_port_cit = { .ct_attrs = target_stat_scsi_port_attrs, .ct_owner = THIS_MODULE, }; @@ -724,7 +724,7 @@ static ssize_t target_stat_tgt_port_hs_in_cmds_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_tgt_port_cit = { +static const struct config_item_type target_stat_scsi_tgt_port_cit = { .ct_attrs = target_stat_scsi_tgt_port_attrs, .ct_owner = THIS_MODULE, }; @@ -844,7 +844,7 @@ static ssize_t target_stat_transport_proto_id_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_transport_cit = { +static const struct config_item_type target_stat_scsi_transport_cit = { .ct_attrs = target_stat_scsi_transport_attrs, .ct_owner = THIS_MODULE, }; @@ -1206,7 +1206,7 @@ static ssize_t target_stat_auth_row_status_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_auth_intr_cit = { +static const struct config_item_type target_stat_scsi_auth_intr_cit = { .ct_attrs = target_stat_scsi_auth_intr_attrs, .ct_owner = THIS_MODULE, }; @@ -1378,7 +1378,7 @@ static ssize_t target_stat_iport_port_ident_show(struct config_item *item, NULL, }; -static struct config_item_type target_stat_scsi_att_intr_port_cit = { +static const struct config_item_type target_stat_scsi_att_intr_port_cit = { .ct_attrs = target_stat_scsi_ath_intr_port_attrs, .ct_owner = THIS_MODULE, };