* [PATCH] xfs: constify sysfs_ops structures
@ 2015-10-11 10:42 Julia Lawall
2015-10-12 12:49 ` Brian Foster
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2015-10-11 10:42 UTC (permalink / raw)
To: Dave Chinner; +Cc: kernel-janitors, xfs, linux-kernel
These sysfs_ops structures are never modified. All other sysfs_ops
structures in the kernel are declared as const.
Done with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
fs/xfs/xfs_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
index aa03670..192c865 100644
--- a/fs/xfs/xfs_sysfs.c
+++ b/fs/xfs/xfs_sysfs.c
@@ -112,7 +112,7 @@ xfs_dbg_store(
return xfs_attr->store ? xfs_attr->store(buf, count, NULL) : 0;
}
-static struct sysfs_ops xfs_dbg_ops = {
+static const struct sysfs_ops xfs_dbg_ops = {
.show = xfs_dbg_show,
.store = xfs_dbg_store,
};
@@ -227,7 +227,7 @@ xfs_log_store(
return xfs_attr->store ? xfs_attr->store(buf, count, log) : 0;
}
-static struct sysfs_ops xfs_log_ops = {
+static const struct sysfs_ops xfs_log_ops = {
.show = xfs_log_show,
.store = xfs_log_store,
};
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfs: constify sysfs_ops structures
2015-10-11 10:42 [PATCH] xfs: constify sysfs_ops structures Julia Lawall
@ 2015-10-12 12:49 ` Brian Foster
0 siblings, 0 replies; 2+ messages in thread
From: Brian Foster @ 2015-10-12 12:49 UTC (permalink / raw)
To: Julia Lawall; +Cc: Dave Chinner, kernel-janitors, linux-kernel, xfs
On Sun, Oct 11, 2015 at 12:42:26PM +0200, Julia Lawall wrote:
> These sysfs_ops structures are never modified. All other sysfs_ops
> structures in the kernel are declared as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
The fix looks correct, but these data structures just happened to be
removed and condensed into a more generic xfs_sysfs_ops definition as
part of the recent per-mount stats series. See commit a27c2640 ("xfs:
consolidate sysfs ops") for reference.
Brian
> ---
> fs/xfs/xfs_sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> index aa03670..192c865 100644
> --- a/fs/xfs/xfs_sysfs.c
> +++ b/fs/xfs/xfs_sysfs.c
> @@ -112,7 +112,7 @@ xfs_dbg_store(
> return xfs_attr->store ? xfs_attr->store(buf, count, NULL) : 0;
> }
>
> -static struct sysfs_ops xfs_dbg_ops = {
> +static const struct sysfs_ops xfs_dbg_ops = {
> .show = xfs_dbg_show,
> .store = xfs_dbg_store,
> };
> @@ -227,7 +227,7 @@ xfs_log_store(
> return xfs_attr->store ? xfs_attr->store(buf, count, log) : 0;
> }
>
> -static struct sysfs_ops xfs_log_ops = {
> +static const struct sysfs_ops xfs_log_ops = {
> .show = xfs_log_show,
> .store = xfs_log_store,
> };
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-12 12:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-11 10:42 [PATCH] xfs: constify sysfs_ops structures Julia Lawall
2015-10-12 12:49 ` Brian Foster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).