Re: [PATCH v3 3/4] system/physmem.c: remove useless assertion of block
Peter Maydell <[email protected]>
| Newsgroups | org.nongnu.qemu-trivial,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <CAFEAcA92MKa1Q1xwamjsFja=-V5ag-JH4kM8xTFiu07RDCBbTQ@mail.gmail.com> |
On Sun, 8 Feb 2026 at 10:41, Sergei Heifetz <[email protected]> wrote: > > It is useless to assert that block is not NULL because > it is already dereferenced in the first line of the function. > > We could split the declaration and initialization of oldsize, > but then we would need to remove the const qualifier. > This seems worse, as the assertion would be almost useless anyway. > > Signed-off-by: Sergei Heifetz <[email protected]> The commit message fails to note the information found during review of the previous version: * this function is called from only two places * those places already either assert or assume that the block argument is not NULL So the assertion is not getting us anything. With the commit message updated: Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM