From patchwork Mon Oct 16 15:18:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 826370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="olV8pkap"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yG2G93lpBz9rvt for ; Tue, 17 Oct 2017 02:25:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753732AbdJPPTV (ORCPT ); Mon, 16 Oct 2017 11:19:21 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:49549 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753703AbdJPPTR (ORCPT ); Mon, 16 Oct 2017 11:19:17 -0400 Received: by mail-wm0-f68.google.com with SMTP id b189so4385729wmd.4; Mon, 16 Oct 2017 08:19:15 -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:in-reply-to:references; bh=mKlm1AwoywTGx62kWE6iGbOscEgVokgM1D18vdQoYVQ=; b=olV8pkapx64DZgP7ZcOna+k0bRAf4n4nZoY42GQzUG4RarniaT0TsTY7Xxtf4xfw0m VTuUsGMaSx267GHv/h/tzNBbbynAA0apqV5ydTWLpwAg4oR5/M3K02h2fHsLMl2ShMS6 +N6FHc8OBDR+2c5pWIzWyI2Cg/4q/ioASvH6WMKqOWHoMiViPwkxxofe4aaa1HYitGOw RoU6E5108rLX8omv/TpNLhABhUSvdyZkXanBNxynq6Xxva7Q5551v1L/f0t8RuEyJhl+ xJDaZiD/CdvKkjNJj+ucGzN+JylbLpY3aPed6PauEef2HRtlTShPTasCcljf23nXCV6U uLgQ== 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:in-reply-to :references; bh=mKlm1AwoywTGx62kWE6iGbOscEgVokgM1D18vdQoYVQ=; b=ZkUS/PISHoTxiXwFtImldsjwCkhoJ+iRcHJ0qSk4lnjVxPma5Bgn9cAR5PzCLaSMEB ZIvGRJd0pUv24x78dar3M66usiHaIrDBKdogRErJWkMrwDDLTwqPlUYKBSsFBspIiz9h gyP70sMpc7oP2DJEoFM42U6Eppfj8Kj8WGuyxScs9lT8SsRShoGgD5ipwO1zxzI4nRns LcAY3ch4GtA5v3SVMV6CdBRP7LNjeKbP/deizSx/uO3Zwa1lPNmLSAqafYRwJYE3iU5R Q7ky6KA+JlmN3G6iv6Yok4ZxYvRpCFBeHEZYG7lHaxlt/ZFYzge07WE9hvhzWZETNabS 8xng== X-Gm-Message-State: AMCzsaW9YVWrfKHDhrvjazPD0UrMullNoudx3bn3FEnlG2pQgglEZKB1 o2BbTLZSEdJamJb6wvsb4J4= X-Google-Smtp-Source: ABhQp+RC1RQNEKWXISIFYIMRHdMlNYB0Jo6hYtGStySF0cbYFxD7rD/s826RCbgNQJ0hG1GbuMeS6g== X-Received: by 10.28.139.72 with SMTP id n69mr1309589wmd.29.1508167154749; Mon, 16 Oct 2017 08:19:14 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id t143sm4588097wmt.45.2017.10.16.08.19.12 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:13 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:12 +0200 From: Bhumika Goyal To: julia.lawall@lip6.fr, rjw@rjwysocki.net, lenb@kernel.org, alexander.shishkin@linux.intel.com, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, hch@lst.de, sagi@grimberg.me, kishon@ti.com, bhelgaas@google.com, nab@linux-iscsi.org, balbi@kernel.org, gregkh@linuxfoundation.org, laurent.pinchart@ideasonboard.com, jlbec@evilplan.org, ccaulfie@redhat.com, teigland@redhat.com, mfasheh@versity.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-usb@vger.kernel.org, cluster-devel@redhat.com, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH v2 03/15] target: make config_item_type const Date: Mon, 16 Oct 2017 17:18:42 +0200 Message-Id: <1508167134-6243-4-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508167134-6243-1-git-send-email-bhumirks@gmail.com> References: <1508167134-6243-1-git-send-email-bhumirks@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/target/iscsi/iscsi_target_stat.c | 12 ++++++------ drivers/target/target_core_configfs.c | 14 +++++++------- drivers/target/target_core_stat.c | 16 ++++++++-------- include/target/iscsi/iscsi_target_stat.h | 12 ++++++------ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_stat.c b/drivers/target/iscsi/iscsi_target_stat.c index 411cb26..df0a398 100644 --- a/drivers/target/iscsi/iscsi_target_stat.c +++ b/drivers/target/iscsi/iscsi_target_stat.c @@ -187,7 +187,7 @@ static ssize_t iscsi_stat_instance_version_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_instance_cit = { +const struct config_item_type iscsi_stat_instance_cit = { .ct_attrs = iscsi_stat_instance_attrs, .ct_owner = THIS_MODULE, }; @@ -249,7 +249,7 @@ static ssize_t iscsi_stat_sess_err_format_errors_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_sess_err_cit = { +const struct config_item_type iscsi_stat_sess_err_cit = { .ct_attrs = iscsi_stat_sess_err_attrs, .ct_owner = THIS_MODULE, }; @@ -390,7 +390,7 @@ static ssize_t iscsi_stat_tgt_attr_fail_intr_addr_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_tgt_attr_cit = { +const struct config_item_type iscsi_stat_tgt_attr_cit = { .ct_attrs = iscsi_stat_tgt_attr_attrs, .ct_owner = THIS_MODULE, }; @@ -522,7 +522,7 @@ static ssize_t iscsi_stat_login_negotiate_fails_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_login_cit = { +const struct config_item_type iscsi_stat_login_cit = { .ct_attrs = iscsi_stat_login_stats_attrs, .ct_owner = THIS_MODULE, }; @@ -579,7 +579,7 @@ static ssize_t iscsi_stat_logout_abnormal_logouts_show(struct config_item *item, NULL, }; -struct config_item_type iscsi_stat_logout_cit = { +const struct config_item_type iscsi_stat_logout_cit = { .ct_attrs = iscsi_stat_logout_stats_attrs, .ct_owner = THIS_MODULE, }; @@ -801,7 +801,7 @@ static ssize_t iscsi_stat_sess_conn_timeout_errors_show( NULL, }; -struct config_item_type iscsi_stat_sess_cit = { +const struct config_item_type iscsi_stat_sess_cit = { .ct_attrs = iscsi_stat_sess_stats_attrs, .ct_owner = THIS_MODULE, }; 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, }; diff --git a/include/target/iscsi/iscsi_target_stat.h b/include/target/iscsi/iscsi_target_stat.h index c27dd47..36e9c9a 100644 --- a/include/target/iscsi/iscsi_target_stat.h +++ b/include/target/iscsi/iscsi_target_stat.h @@ -8,16 +8,16 @@ /* * For struct iscsi_tiqn->tiqn_wwn default groups */ -extern struct config_item_type iscsi_stat_instance_cit; -extern struct config_item_type iscsi_stat_sess_err_cit; -extern struct config_item_type iscsi_stat_tgt_attr_cit; -extern struct config_item_type iscsi_stat_login_cit; -extern struct config_item_type iscsi_stat_logout_cit; +extern const struct config_item_type iscsi_stat_instance_cit; +extern const struct config_item_type iscsi_stat_sess_err_cit; +extern const struct config_item_type iscsi_stat_tgt_attr_cit; +extern const struct config_item_type iscsi_stat_login_cit; +extern const struct config_item_type iscsi_stat_logout_cit; /* * For struct iscsi_session->se_sess default groups */ -extern struct config_item_type iscsi_stat_sess_cit; +extern const struct config_item_type iscsi_stat_sess_cit; /* iSCSI session error types */ #define ISCSI_SESS_ERR_UNKNOWN 0