From patchwork Mon Oct 16 15:18:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 10008749 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 EFA71601D5 for ; Mon, 16 Oct 2017 15:23:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE63E285FE for ; Mon, 16 Oct 2017 15:23:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D292928600; Mon, 16 Oct 2017 15:23:44 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 6264F285FE for ; Mon, 16 Oct 2017 15:23:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754037AbdJPPX0 (ORCPT ); Mon, 16 Oct 2017 11:23:26 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:49042 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753821AbdJPPTb (ORCPT ); Mon, 16 Oct 2017 11:19:31 -0400 Received: by mail-wm0-f68.google.com with SMTP id i124so4405575wmf.3; Mon, 16 Oct 2017 08:19:29 -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=m2mTkeflinGWSxDP4kcTFh51STbx1Z1woq7uvhqkFOM=; b=Kgj/4AnndjfJjpiDLuTHMbOziCvwSDOinLidIG6Ce1zbJLEiIAFXr+AQwo12mNcbJC 3Ia1cNjgXAhif7RonvfGMwTFFXDLwnaZtGZv4AXgSBTrtIGuMFOr8Qd1NilG3cVQ7JkN busYMR7vLSm13m51ZjpzPDQqNMBOKR0Sz5ycQ07D25BTtOuP8TWlybCEUuzvTsM/ykEG F4LAwZH6TwI5pqxxqvKze9hBMr0FK/mhtBlA0vbEh6yLLeWWJDruR+atz6tq1AVtgX7Y Xnxeduu+wpIYS9JC5qvppO4oz502wuEH2ROtisoBo8dVZAHKiBTTK+OeGB1cZK5PRODm g3gg== 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=m2mTkeflinGWSxDP4kcTFh51STbx1Z1woq7uvhqkFOM=; b=mPfu5QMvGMSp6R67cOwNZIEXO6OXll4kPd0xUmVrP/ocWcOBp7IyVqv47nhpiPX8vQ UaR5QSM5MCMbQOqiEePOzgNS6huj6FU58jaBlvlEIupHj5W1yDuFtlIu3u2e48+U9MrG VDmPNji6g67rG1qRFz5gpj6mlRB0GBcUu7VhHaxgHIlwPfGZXdwDhvaC/Tt7fUc4+NNU 74Hbo0eIrxxIfDkdHY6bt4rR+D1fIYxKxLcww1oKEi7QUnIT59x237q7OnsjlFYAsOm0 X2afcF0cGF5RJlFZ+SvoRlw3On7g9QRtUC2fpYM0Nw8Xe9NPGy8D+V7Rstt5v91EaMI1 KS9g== X-Gm-Message-State: AMCzsaUWtmIrtDuHaL2agRSktARMIxSuDCMd8AmHEvBG751QL5s5q+a2 QJdvuk+k1nbwC/B70U9P52g= X-Google-Smtp-Source: ABhQp+QWkfAo73J2cIjiyIkohdlTpwV6N2VJzQ1HWLD1fJV8GjLSW5RCg+WOKt0PlGY9D07AnJLfdg== X-Received: by 10.223.134.250 with SMTP id 55mr971366wry.249.1508167168452; Mon, 16 Oct 2017 08:19:28 -0700 (PDT) Received: from gmail.com (dell-goyal.wifi.rsr.lip6.fr. [132.227.77.190]) by smtp.gmail.com with ESMTPSA id 188sm6149773wmg.45.2017.10.16.08.19.25 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 08:19:27 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 16 Oct 2017 17:19:25 +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 08/15] nvmet: make config_item_type const Date: Mon, 16 Oct 2017 17:18:47 +0200 Message-Id: <1508167134-6243-9-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-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make config_item_type structures const as they are either passed to a function having the argument as const or used inside an if statement or stored in the const "ci_type" field of a config_item structure. Done using Coccinelle Signed-off-by: Bhumika Goyal Acked-by: Sagi Grimberg --- * Changes in v2- Combine all the followup patches and the constification patches into a series. drivers/nvme/target/configfs.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c index b6aeb1d..e6b2d2a 100644 --- a/drivers/nvme/target/configfs.c +++ b/drivers/nvme/target/configfs.c @@ -20,8 +20,8 @@ #include "nvmet.h" -static struct config_item_type nvmet_host_type; -static struct config_item_type nvmet_subsys_type; +static const struct config_item_type nvmet_host_type; +static const struct config_item_type nvmet_subsys_type; /* * nvmet_port Generic ConfigFS definitions. @@ -425,7 +425,7 @@ static void nvmet_ns_release(struct config_item *item) .release = nvmet_ns_release, }; -static struct config_item_type nvmet_ns_type = { +static const struct config_item_type nvmet_ns_type = { .ct_item_ops = &nvmet_ns_item_ops, .ct_attrs = nvmet_ns_attrs, .ct_owner = THIS_MODULE, @@ -464,7 +464,7 @@ static struct config_group *nvmet_ns_make(struct config_group *group, .make_group = nvmet_ns_make, }; -static struct config_item_type nvmet_namespaces_type = { +static const struct config_item_type nvmet_namespaces_type = { .ct_group_ops = &nvmet_namespaces_group_ops, .ct_owner = THIS_MODULE, }; @@ -540,7 +540,7 @@ static void nvmet_port_subsys_drop_link(struct config_item *parent, .drop_link = nvmet_port_subsys_drop_link, }; -static struct config_item_type nvmet_port_subsys_type = { +static const struct config_item_type nvmet_port_subsys_type = { .ct_item_ops = &nvmet_port_subsys_item_ops, .ct_owner = THIS_MODULE, }; @@ -613,7 +613,7 @@ static void nvmet_allowed_hosts_drop_link(struct config_item *parent, .drop_link = nvmet_allowed_hosts_drop_link, }; -static struct config_item_type nvmet_allowed_hosts_type = { +static const struct config_item_type nvmet_allowed_hosts_type = { .ct_item_ops = &nvmet_allowed_hosts_item_ops, .ct_owner = THIS_MODULE, }; @@ -729,7 +729,7 @@ static void nvmet_subsys_release(struct config_item *item) .release = nvmet_subsys_release, }; -static struct config_item_type nvmet_subsys_type = { +static const struct config_item_type nvmet_subsys_type = { .ct_item_ops = &nvmet_subsys_item_ops, .ct_attrs = nvmet_subsys_attrs, .ct_owner = THIS_MODULE, @@ -767,7 +767,7 @@ static struct config_group *nvmet_subsys_make(struct config_group *group, .make_group = nvmet_subsys_make, }; -static struct config_item_type nvmet_subsystems_type = { +static const struct config_item_type nvmet_subsystems_type = { .ct_group_ops = &nvmet_subsystems_group_ops, .ct_owner = THIS_MODULE, }; @@ -827,7 +827,7 @@ static void nvmet_referral_release(struct config_item *item) .release = nvmet_referral_release, }; -static struct config_item_type nvmet_referral_type = { +static const struct config_item_type nvmet_referral_type = { .ct_owner = THIS_MODULE, .ct_attrs = nvmet_referral_attrs, .ct_item_ops = &nvmet_referral_item_ops, @@ -852,7 +852,7 @@ static struct config_group *nvmet_referral_make( .make_group = nvmet_referral_make, }; -static struct config_item_type nvmet_referrals_type = { +static const struct config_item_type nvmet_referrals_type = { .ct_owner = THIS_MODULE, .ct_group_ops = &nvmet_referral_group_ops, }; @@ -880,7 +880,7 @@ static void nvmet_port_release(struct config_item *item) .release = nvmet_port_release, }; -static struct config_item_type nvmet_port_type = { +static const struct config_item_type nvmet_port_type = { .ct_attrs = nvmet_port_attrs, .ct_item_ops = &nvmet_port_item_ops, .ct_owner = THIS_MODULE, @@ -921,7 +921,7 @@ static struct config_group *nvmet_ports_make(struct config_group *group, .make_group = nvmet_ports_make, }; -static struct config_item_type nvmet_ports_type = { +static const struct config_item_type nvmet_ports_type = { .ct_group_ops = &nvmet_ports_group_ops, .ct_owner = THIS_MODULE, }; @@ -940,7 +940,7 @@ static void nvmet_host_release(struct config_item *item) .release = nvmet_host_release, }; -static struct config_item_type nvmet_host_type = { +static const struct config_item_type nvmet_host_type = { .ct_item_ops = &nvmet_host_item_ops, .ct_owner = THIS_MODULE, }; @@ -963,14 +963,14 @@ static struct config_group *nvmet_hosts_make_group(struct config_group *group, .make_group = nvmet_hosts_make_group, }; -static struct config_item_type nvmet_hosts_type = { +static const struct config_item_type nvmet_hosts_type = { .ct_group_ops = &nvmet_hosts_group_ops, .ct_owner = THIS_MODULE, }; static struct config_group nvmet_hosts_group; -static struct config_item_type nvmet_root_type = { +static const struct config_item_type nvmet_root_type = { .ct_owner = THIS_MODULE, };