Re: [PATCH 3/4] system/physmem.c: reorder usage and assertion of block

Peter Maydell <[email protected]>
Newsgroups org.nongnu.qemu-trivial,org.nongnu.qemu-devel
Message-ID <CAFEAcA9TFgGrXx9TfC1jr=VOOJzoAQqirbDOyf2PU3cMXc9iLw@mail.gmail.com>
On Fri, 6 Feb 2026 at 13:33, Sergei Heifetz <[email protected]> wrote:
>
>
>
> According to coding style (docs/devel/style.rst):
>
> Mixed declarations (interleaving statements and declarations within
> blocks) are generally not allowed.
>
>
>        newsize = TARGET_PAGE_ALIGN(newsize);
>        newsize = REAL_HOST_PAGE_ALIGN(newsize);
>
>
>
> Hello, Laurent. Please note that I didn't touch these lines.

Laurent's comment is not about those two lines, but about
the ones above, that you don't quote in your reply. (Laurent
is following the usual mailing list style of interleaved commentary,
so his remark follows the part of your email that it is in
response to.)

> @@ -2054,11 +2054,11 @@ static int memory_try_enable_merging(void *addr, size_t len)
>    */
>   int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp)
>   {
> +    assert(block);
> +
>       const ram_addr_t oldsize = block->used_length;
>       const ram_addr_t unaligned_size = newsize;
>
> -    assert(block);
> -

You've moved a code line (the assert) above the declaration lines, so
the function used to follow this coding style rule, but now it doesn't.

thanks
-- PMM
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.