damon.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: SeongJae Park <sj@kernel.org>, kernel test robot <lkp@intel.com>,
	llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	damon@lists.linux.dev, Kees Cook <keescook@chromium.org>,
	Bill Wendling <morbo@google.com>
Subject: Re: [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members
Date: Tue, 19 Dec 2023 17:16:57 +0000	[thread overview]
Message-ID: <20231219171658.107144-1-sj@kernel.org> (raw)
In-Reply-To: <CAKwvOdkvGTGiWzqEFq=kzqvxSYP5vUj3g9Z-=MZSQROzzSa_dg@mail.gmail.com>

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

      reply	other threads:[~2023-12-19 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202312190546.yhWbDA8A-lkp@intel.com>
2023-12-19  2:19 ` [sj:damon/next 18/24] mm/damon/sysfs.c:96:30: error: 'counted_by' only applies to C99 flexible array members SeongJae Park
2023-12-19 16:47   ` Nick Desaulniers
2023-12-19 17:16     ` SeongJae Park [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231219171658.107144-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=keescook@chromium.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=ndesaulniers@google.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).