Re: [RFC PATCH v2 09/17] mm/damon/sysfs: implement preps directory

SJ Park <[email protected]> Sun, 26 Jul 2026 12:41:06 -0700
Newsgroups dev.linux.lists.damon
Message-ID <[email protected]>
On Sun, 26 Jul 2026 11:54:32 -0700 SJ Park <[email protected]> wrote:

> On Sun, 26 Jul 2026 17:46:08 +0000 [email protected] wrote:
> 
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [Low] The kobj_type structure `damon_sysfs_preps_ktype` is missing the `static` keyword.
> > --
> > 
> > --- Patch [9]: [RFC PATCH v2 09/17] mm/damon/sysfs: implement preps directory ---
> > commit 8155aac7530c47520c4a221fb588dbd6e53e3875
> > Author: SJ Park <[email protected]>
> > 
> > mm/damon/sysfs: implement preps directory
> >     
> > This commit implements a sysfs directory and a file for setting DAMON probe
> > preps. It introduces the preparatory data structures and functions without
> > actually generating the directories yet.
> > 
> > > diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
> > > index 50ff1c172d746..bf65e87fcb521 100644
> > > --- a/mm/damon/sysfs.c
> > > +++ b/mm/damon/sysfs.c
> > 
> > [ ... ]
> > 
> > > @@ -750,6 +750,74 @@ static const struct kobj_type damon_sysfs_intervals_ktype = {
> > >  	.default_groups = damon_sysfs_intervals_groups,
> > >  };
> > >  
> > 
> > [ ... ]
> > 
> > > +static struct attribute *damon_sysfs_preps_attrs[] = {
> > > +	&damon_sysfs_preps_nr_attr.attr,
> > > +	NULL,
> > > +};
> > > +ATTRIBUTE_GROUPS(damon_sysfs_preps);
> > > +
> > > +const struct kobj_type damon_sysfs_preps_ktype = {
> > [Severity: Low]
> > Does this inadvertently expose damon_sysfs_preps_ktype to the global
> > namespace?
> > 
> > It looks like the static keyword is missing on the definition of
> > damon_sysfs_preps_ktype, which will cause it to be globally visible and may
> > trigger static analysis warnings.
> 
> This is an intended thing, for not causing build warning, while splitting
> change in reviewable size.

I will fix this.

> 
> > 
> > > +	.release = damon_sysfs_preps_release,
> > > +	.sysfs_ops = &kobj_sysfs_ops,
> > > +	.default_groups = damon_sysfs_preps_groups,
> > > +};
> > > +
> > >  /*
> > >   * filter directory
> > >   */
> > 
> > -- 
> > Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=9
> 
> 
> Thanks,
> SJ
> 


Thanks,
SJ