Re: [RFC PATCH 13/19] mm/damon/sysfs: implement filter dir files

SeongJae Park
2026-04-28T00:45:03Z

On Mon, 27 Apr 2026 16:24:10 +0300 Gutierrez Asier <gutierrez.asier@huawei-partners.com> wrote:

>
>
> On 4/26/2026 11:52 PM, SeongJae Park wrote:
> > Implement sysfs files under the data probe filter directory for letting
> > users to configure each filter.
> >
> > Signed-off-by: SeongJae Park <sj@kernel.org>
> > ---
[...]
> > +static ssize_t type_show(struct kobject *kobj,
> > + struct kobj_attribute *attr, char *buf)
> > +{
> > + struct damon_sysfs_filter *filter = container_of(kobj,
> > + struct damon_sysfs_filter, kobj);
> > + int i;
> > +
> > + for (i = 0; i < ARRAY_SIZE(damon_sysfs_filter_type_names); i++) {
> > + const struct damon_sysfs_filter_type_name *type_name;
> Can we move this declaration to the top of the function?

Unfortunately other parts of sysfs.c and sysfs-schemes.c including
operations_show/store(), type_show/sotre(), metric_show/store() are also using
this pattern. I'd like to keep the style consistency, if I'm not missing
something and you don't mind.

Thanks,
SJ …