* [PATCH] dlm: make config_item_type const
@ 2017-10-12 13:22 Bhumika Goyal
2017-10-12 15:03 ` Bhumika Goyal
0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2017-10-12 13:22 UTC (permalink / raw)
To: julia.lawall, ccaulfie, teigland, cluster-devel, linux-kernel
Cc: Bhumika Goyal
This is a followup patch for:
https://patchwork.kernel.org/patch/9999649/ and
https://lkml.org/lkml/2017/10/11/375
Make config_item_type structures const as they are either passed to a
function having the argument as const or stored in the const "ci_type"
field of a config_item structure.
Done using Coccinelle.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
fs/dlm/config.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index 7211e82..1270551 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -282,44 +282,44 @@ struct dlm_node {
.release = release_node,
};
-static struct config_item_type clusters_type = {
+static const struct config_item_type clusters_type = {
.ct_group_ops = &clusters_ops,
.ct_owner = THIS_MODULE,
};
-static struct config_item_type cluster_type = {
+static const struct config_item_type cluster_type = {
.ct_item_ops = &cluster_ops,
.ct_attrs = cluster_attrs,
.ct_owner = THIS_MODULE,
};
-static struct config_item_type spaces_type = {
+static const struct config_item_type spaces_type = {
.ct_group_ops = &spaces_ops,
.ct_owner = THIS_MODULE,
};
-static struct config_item_type space_type = {
+static const struct config_item_type space_type = {
.ct_item_ops = &space_ops,
.ct_owner = THIS_MODULE,
};
-static struct config_item_type comms_type = {
+static const struct config_item_type comms_type = {
.ct_group_ops = &comms_ops,
.ct_owner = THIS_MODULE,
};
-static struct config_item_type comm_type = {
+static const struct config_item_type comm_type = {
.ct_item_ops = &comm_ops,
.ct_attrs = comm_attrs,
.ct_owner = THIS_MODULE,
};
-static struct config_item_type nodes_type = {
+static const struct config_item_type nodes_type = {
.ct_group_ops = &nodes_ops,
.ct_owner = THIS_MODULE,
};
-static struct config_item_type node_type = {
+static const struct config_item_type node_type = {
.ct_item_ops = &node_ops,
.ct_attrs = node_attrs,
.ct_owner = THIS_MODULE,
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dlm: make config_item_type const
2017-10-12 13:22 [PATCH] dlm: make config_item_type const Bhumika Goyal
@ 2017-10-12 15:03 ` Bhumika Goyal
0 siblings, 0 replies; 2+ messages in thread
From: Bhumika Goyal @ 2017-10-12 15:03 UTC (permalink / raw)
To: Julia Lawall, ccaulfie, teigland, cluster-devel,
Linux Kernel Mailing List
Cc: Bhumika Goyal
On Thu, Oct 12, 2017 at 3:22 PM, Bhumika Goyal <bhumirks@gmail.com> wrote:
> This is a followup patch for:
> https://patchwork.kernel.org/patch/9999649/ and
> https://lkml.org/lkml/2017/10/11/375
>
> Make config_item_type structures const as they are either passed to a
> function having the argument as const or stored in the const "ci_type"
> field of a config_item structure.
>
> Done using Coccinelle.
>
Actually, this patch is dependent on the patches in the links
https://lkml.org/lkml/2017/10/11/375 and
https://patchwork.kernel.org/patch/9999649/. Therefore, this patch
won't be correct unless the patches in these links gets applied.
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> fs/dlm/config.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/fs/dlm/config.c b/fs/dlm/config.c
> index 7211e82..1270551 100644
> --- a/fs/dlm/config.c
> +++ b/fs/dlm/config.c
> @@ -282,44 +282,44 @@ struct dlm_node {
> .release = release_node,
> };
>
> -static struct config_item_type clusters_type = {
> +static const struct config_item_type clusters_type = {
> .ct_group_ops = &clusters_ops,
> .ct_owner = THIS_MODULE,
> };
>
> -static struct config_item_type cluster_type = {
> +static const struct config_item_type cluster_type = {
> .ct_item_ops = &cluster_ops,
> .ct_attrs = cluster_attrs,
> .ct_owner = THIS_MODULE,
> };
>
> -static struct config_item_type spaces_type = {
> +static const struct config_item_type spaces_type = {
> .ct_group_ops = &spaces_ops,
> .ct_owner = THIS_MODULE,
> };
>
> -static struct config_item_type space_type = {
> +static const struct config_item_type space_type = {
> .ct_item_ops = &space_ops,
> .ct_owner = THIS_MODULE,
> };
>
> -static struct config_item_type comms_type = {
> +static const struct config_item_type comms_type = {
> .ct_group_ops = &comms_ops,
> .ct_owner = THIS_MODULE,
> };
>
> -static struct config_item_type comm_type = {
> +static const struct config_item_type comm_type = {
> .ct_item_ops = &comm_ops,
> .ct_attrs = comm_attrs,
> .ct_owner = THIS_MODULE,
> };
>
> -static struct config_item_type nodes_type = {
> +static const struct config_item_type nodes_type = {
> .ct_group_ops = &nodes_ops,
> .ct_owner = THIS_MODULE,
> };
>
> -static struct config_item_type node_type = {
> +static const struct config_item_type node_type = {
> .ct_item_ops = &node_ops,
> .ct_attrs = node_attrs,
> .ct_owner = THIS_MODULE,
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-12 15:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 13:22 [PATCH] dlm: make config_item_type const Bhumika Goyal
2017-10-12 15:03 ` Bhumika Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®