On Thu, 25 Jun 2020 at 10:18, P J P <ppan...@redhat.com> wrote:
>
> +-- On Thu, 25 Jun 2020, Philippe Mathieu-Daudé wrote --+
> | > @@ -196,7 +196,22 @@ static bool tz_ppc_dummy_accepts(void *opaque, 
> hwaddr addr,
> | >      g_assert_not_reached();
> |
> | This is a shame we now have to fill the read/write handlers for
> | unreachable code :(
> |
> | > +static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned 
> size)
> |
> | I'd instead use a clearer:
> |        g_assert_not_reached();
> |
> | > +static void tz_ppc_dummy_write(void *opaque, hwaddr addr,
> |
> | Ditto:
> |        g_assert_not_reached();
>
> This will likely be called in tz_ppc_dummy_accepts() above. Do we still want
> to revise this patch? considering read/write callbacks are unreachable.

The point of g_assert_not_reached() is that it documents and
asserts that the code is not reachable. If the read and write
callbacks are unreachable (which they are) then having their
bodies just be a call to g_assert_not_reached() is the best
way to document that.

thanks
-- PMM

Reply via email to