public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
@ 2023-12-18 21:30 kernel test robot
  2023-12-19  2:19 ` SeongJae Park
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2023-12-18 21:30 UTC (permalink / raw)
  To: SeongJae Park; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
head:   04cc9f72453632bf9e13e06f85c11147583e5d5d
commit: 375af4a6e206c1aeb2edb1d80cbb42fd3349b287 [18/24] mm/damon/sysfs: add __counted_by() annotation
config: arm-randconfig-001-20231219 (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 5ac12951b4e9bbfcc5791282d0961ec2b65575e9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312190546.yhWbDA8A-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
      96 |         struct damon_sysfs_region **regions_arr __counted_by(nr);
         |                                     ^~~~~~~~~~~
   mm/damon/sysfs.c:292:30: error: 'counted_by' only applies to C99 flexible array members
     292 |         struct damon_sysfs_target **targets_arr __counted_by(nr);
         |                                     ^~~~~~~~~~~
   mm/damon/sysfs.c:815:31: error: 'counted_by' only applies to C99 flexible array members
     815 |         struct damon_sysfs_context **contexts_arr __counted_by(nr);
         |                                      ^~~~~~~~~~~~
   mm/damon/sysfs.c:1666:31: error: 'counted_by' only applies to C99 flexible array members
    1666 |         struct damon_sysfs_kdamond **kdamonds_arr __counted_by(nr);
         |                                      ^~~~~~~~~~~~
   4 errors generated.


vim +/counted_by +96 mm/damon/sysfs.c

    89	
    90	/*
    91	 * init_regions directory
    92	 */
    93	
    94	struct damon_sysfs_regions {
    95		struct kobject kobj;
  > 96		struct damon_sysfs_region **regions_arr __counted_by(nr);
    97		int nr;
    98	};
    99	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
  2023-12-18 21:30 [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members kernel test robot
@ 2023-12-19  2:19 ` SeongJae Park
  2023-12-19 16:47   ` Nick Desaulniers
  0 siblings, 1 reply; 4+ messages in thread
From: SeongJae Park @ 2023-12-19  2:19 UTC (permalink / raw)
  To: kernel test robot; +Cc: SeongJae Park, llvm, oe-kbuild-all, damon

Hello,

On Tue, 19 Dec 2023 05:30:54 +0800 kernel test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
> head:   04cc9f72453632bf9e13e06f85c11147583e5d5d
> commit: 375af4a6e206c1aeb2edb1d80cbb42fd3349b287 [18/24] mm/damon/sysfs: add __counted_by() annotation
> config: arm-randconfig-001-20231219 (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/config)
> compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 5ac12951b4e9bbfcc5791282d0961ec2b65575e9)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202312190546.yhWbDA8A-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
>       96 |         struct damon_sysfs_region **regions_arr __counted_by(nr);
>          |                                     ^~~~~~~~~~~
>    mm/damon/sysfs.c:292:30: error: 'counted_by' only applies to C99 flexible array members
>      292 |         struct damon_sysfs_target **targets_arr __counted_by(nr);
>          |                                     ^~~~~~~~~~~
>    mm/damon/sysfs.c:815:31: error: 'counted_by' only applies to C99 flexible array members
>      815 |         struct damon_sysfs_context **contexts_arr __counted_by(nr);
>          |                                      ^~~~~~~~~~~~
>    mm/damon/sysfs.c:1666:31: error: 'counted_by' only applies to C99 flexible array members
>     1666 |         struct damon_sysfs_kdamond **kdamonds_arr __counted_by(nr);
>          |                                      ^~~~~~~~~~~~
>    4 errors generated.
> 
> 
> vim +/counted_by +96 mm/damon/sysfs.c
> 
>     89	
>     90	/*
>     91	 * init_regions directory
>     92	 */
>     93	
>     94	struct damon_sysfs_regions {
>     95		struct kobject kobj;
>   > 96		struct damon_sysfs_region **regions_arr __counted_by(nr);
>     97		int nr;
>     98	};
>     99	

Thank you for this report.  I will remove the commit from the tree.


Thanks,
SJ

> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
  2023-12-19  2:19 ` SeongJae Park
@ 2023-12-19 16:47   ` Nick Desaulniers
  2023-12-19 17:16     ` SeongJae Park
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Desaulniers @ 2023-12-19 16:47 UTC (permalink / raw)
  To: SeongJae Park
  Cc: kernel test robot, llvm, oe-kbuild-all, damon, Kees Cook,
	Bill Wendling

On Mon, Dec 18, 2023 at 6:20 PM SeongJae Park <sj@kernel.org> wrote:
>
> Hello,
>
> On Tue, 19 Dec 2023 05:30:54 +0800 kernel test robot <lkp@intel.com> wrote:
>
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
> > head:   04cc9f72453632bf9e13e06f85c11147583e5d5d
> > commit: 375af4a6e206c1aeb2edb1d80cbb42fd3349b287 [18/24] mm/damon/sysfs: add __counted_by() annotation
> > config: arm-randconfig-001-20231219 (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/config)
> > compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 5ac12951b4e9bbfcc5791282d0961ec2b65575e9)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202312190546.yhWbDA8A-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> > >> mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
> >       96 |         struct damon_sysfs_region **regions_arr __counted_by(nr);
> >          |                                     ^~~~~~~~~~~
> >    mm/damon/sysfs.c:292:30: error: 'counted_by' only applies to C99 flexible array members
> >      292 |         struct damon_sysfs_target **targets_arr __counted_by(nr);
> >          |                                     ^~~~~~~~~~~
> >    mm/damon/sysfs.c:815:31: error: 'counted_by' only applies to C99 flexible array members
> >      815 |         struct damon_sysfs_context **contexts_arr __counted_by(nr);
> >          |                                      ^~~~~~~~~~~~
> >    mm/damon/sysfs.c:1666:31: error: 'counted_by' only applies to C99 flexible array members
> >     1666 |         struct damon_sysfs_kdamond **kdamonds_arr __counted_by(nr);
> >          |                                      ^~~~~~~~~~~~
> >    4 errors generated.
> >
> >
> > vim +/counted_by +96 mm/damon/sysfs.c
> >
> >     89
> >     90        /*
> >     91         * init_regions directory
> >     92         */
> >     93
> >     94        struct damon_sysfs_regions {
> >     95                struct kobject kobj;
> >   > 96                struct damon_sysfs_region **regions_arr __counted_by(nr);
> >     97                int nr;
> >     98        };
> >     99
>
> Thank you for this report.  I will remove the commit from the tree.

Being able to annotate pointers with this attribute is in the works
(but is not ready yet). Thanks for thinking of this and trying it out
though! Consider adding a todo to add such attribute in the future!


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
  2023-12-19 16:47   ` Nick Desaulniers
@ 2023-12-19 17:16     ` SeongJae Park
  0 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2023-12-19 17:16 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: SeongJae Park, kernel test robot, llvm, oe-kbuild-all, damon,
	Kees Cook, Bill Wendling

Hi Nick,

On Tue, 19 Dec 2023 08:47:03 -0800 Nick Desaulniers <ndesaulniers@google.com> wrote:

> On Mon, Dec 18, 2023 at 6:20\u202fPM SeongJae Park <sj@kernel.org> wrote:
> >
> > Hello,
> >
> > On Tue, 19 Dec 2023 05:30:54 +0800 kernel test robot <lkp@intel.com> wrote:
> >
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sj/linux.git damon/next
> > > head:   04cc9f72453632bf9e13e06f85c11147583e5d5d
> > > commit: 375af4a6e206c1aeb2edb1d80cbb42fd3349b287 [18/24] mm/damon/sysfs: add __counted_by() annotation
> > > config: arm-randconfig-001-20231219 (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/config)
> > > compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 5ac12951b4e9bbfcc5791282d0961ec2b65575e9)
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312190546.yhWbDA8A-lkp@intel.com/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202312190546.yhWbDA8A-lkp@intel.com/
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > > >> mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
> > >       96 |         struct damon_sysfs_region **regions_arr __counted_by(nr);
> > >          |                                     ^~~~~~~~~~~
> > >    mm/damon/sysfs.c:292:30: error: 'counted_by' only applies to C99 flexible array members
> > >      292 |         struct damon_sysfs_target **targets_arr __counted_by(nr);
> > >          |                                     ^~~~~~~~~~~
> > >    mm/damon/sysfs.c:815:31: error: 'counted_by' only applies to C99 flexible array members
> > >      815 |         struct damon_sysfs_context **contexts_arr __counted_by(nr);
> > >          |                                      ^~~~~~~~~~~~
> > >    mm/damon/sysfs.c:1666:31: error: 'counted_by' only applies to C99 flexible array members
> > >     1666 |         struct damon_sysfs_kdamond **kdamonds_arr __counted_by(nr);
> > >          |                                      ^~~~~~~~~~~~
> > >    4 errors generated.
> > >
> > >
> > > vim +/counted_by +96 mm/damon/sysfs.c
> > >
> > >     89
> > >     90        /*
> > >     91         * init_regions directory
> > >     92         */
> > >     93
> > >     94        struct damon_sysfs_regions {
> > >     95                struct kobject kobj;
> > >   > 96                struct damon_sysfs_region **regions_arr __counted_by(nr);
> > >     97                int nr;
> > >     98        };
> > >     99
> >
> > Thank you for this report.  I will remove the commit from the tree.
> 
> Being able to annotate pointers with this attribute is in the works
> (but is not ready yet). Thanks for thinking of this and trying it out
> though! Consider adding a todo to add such attribute in the future!

Thank you for the suggestion.  I added an item for this on my humble TODO
list[1].  Doing this also reminded me that I should cleanup the list :)  Thank
you!

[1] https://git.kernel.org/pub/scm/linux/kernel/git/sj/damon-hack.git/commit/?id=9ef6f86a5cc37


Thanks,
SJ

> 
> 
> -- 
> Thanks,
> ~Nick Desaulniers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-19 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 21:30 [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members kernel test robot
2023-12-19  2:19 ` SeongJae Park
2023-12-19 16:47   ` Nick Desaulniers
2023-12-19 17:16     ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox