From: Kees Cook <keescook@chromium.org>
To: Joe Perches <joe@perches.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: Re: [PATCH] overflow.h: Add flex_array_size() helper
Date: Tue, 9 Jun 2020 08:26:49 -0700 [thread overview]
Message-ID: <202006090819.92840D81@keescook> (raw)
In-Reply-To: <05ab102b936ce922c4fae67bf5dd3e323aff0b93.camel@perches.com>
On Mon, Jun 08, 2020 at 03:34:52PM -0700, Joe Perches wrote:
> On Mon, 2020-06-08 at 17:17 -0500, Gustavo A. R. Silva wrote:
> > Add flex_array_size() helper for the calculation of the size, in bytes,
> > of a flexible array member contained within an enclosing structure.
> >
> > Example of usage:
> > foo
> > struct something {
> > size_t count;
> > struct foo items[];
> > };
> >
> > struct something *instance;
> []
> > diff --git a/include/linux/overflow.h b/include/linux/overflow.h
> []
> > +/**
> > + * flex_array_size() - Calculate size of a flexible array member within
> > + * an enclosing structure.
>
> These comment descriptions do not match
>
> > + * Calculates size of memory needed for flexible array @member of @count
> > + * elements within structure @p.
>
> The first comment shows the size of an array member.
Ah, I see what you mean. I was parsing it as "flexible-array structure member"
but it does say "a" and "array member". Perhaps:
Calculate size needed for entire flexible array contents within an
enclosing structure.
?
--
Kees Cook
prev parent reply other threads:[~2020-06-09 15:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-08 22:17 [PATCH] overflow.h: Add flex_array_size() helper Gustavo A. R. Silva
2020-06-08 22:34 ` Joe Perches
2020-06-09 0:47 ` Gustavo A. R. Silva
2020-06-09 15:26 ` Kees Cook [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=202006090819.92840D81@keescook \
--to=keescook@chromium.org \
--cc=gustavo@embeddedor.com \
--cc=gustavoars@kernel.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/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