From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: Use sizeof directly instead of a constant variable
Date: Wed, 14 Mar 2018 19:20:39 +0100 [thread overview]
Message-ID: <20180314182039.GP32007@twin.jikos.cz> (raw)
In-Reply-To: <1520929566-4155-1-git-send-email-nborisov@suse.com>
On Tue, Mar 13, 2018 at 10:26:06AM +0200, Nikolay Borisov wrote:
> The kernel would like to have all stack VLA usage removed[1].
> Unfortunately using an integer constant variable as the size of an
> array is still considered a VLA. Instead let's use directly sizeof(var)
> which removes the VLA usage. Use the occasion to remove csum_size
> altogether and use sizeof() also for the size passed to memcmp
>
> [1]: https://lkml.org/lkml/2018/3/7/621
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>
> V2:
> * Use sizeof(result) in memcmp to make it more clear what we are comparing.
Reviewed-by: David Sterba <dsterba@suse.com>
Added to next, thanks.
prev parent reply other threads:[~2018-03-14 18:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 16:52 [PATCH] btrfs: Use sizeof directly instead of a constant variable Nikolay Borisov
2018-03-12 16:58 ` David Sterba
2018-03-13 8:26 ` [PATCH v2] " Nikolay Borisov
2018-03-14 18:20 ` David Sterba [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=20180314182039.GP32007@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
/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 NNTP newsgroup(s).