Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bhumirks@gmail.com (Bhumika Goyal)
Subject: [PATCH] nvme: make config_item_type __ro_after_init
Date: Mon,  2 Oct 2017 00:44:38 +0530	[thread overview]
Message-ID: <1506885278-9234-1-git-send-email-bhumirks@gmail.com> (raw)

Make these __ro_after_init as they are only stored as a reference in the
ci_type field of a config_item structure during the init phase in the
function config_group_init_type_name. None of the fields of these
structures are modified after the init phase, so they can be
__ro_after_init.

Structures found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks at gmail.com>
---
 drivers/nvme/target/configfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
index b6aeb1d..075d9b5 100644
--- a/drivers/nvme/target/configfs.c
+++ b/drivers/nvme/target/configfs.c
@@ -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 struct config_item_type nvmet_subsystems_type __ro_after_init = {
 	.ct_group_ops		= &nvmet_subsystems_group_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 struct config_item_type nvmet_ports_type __ro_after_init = {
 	.ct_group_ops		= &nvmet_ports_group_ops,
 	.ct_owner		= THIS_MODULE,
 };
@@ -963,7 +963,7 @@ 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 struct config_item_type nvmet_hosts_type __ro_after_init = {
 	.ct_group_ops		= &nvmet_hosts_group_ops,
 	.ct_owner		= THIS_MODULE,
 };
-- 
1.9.1

             reply	other threads:[~2017-10-01 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-01 19:14 Bhumika Goyal [this message]
2017-10-02  8:18 ` [PATCH] nvme: make config_item_type __ro_after_init Bhumika Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1506885278-9234-1-git-send-email-bhumirks@gmail.com \
    --to=bhumirks@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox