On Tue, 7 Oct 2025 at 15:47, Philippe Mathieu-Daudé <[email protected]> wrote:
>
> On 7/10/25 15:48, Philippe Mathieu-Daudé wrote:
> > On 7/10/25 10:27, Peter Maydell wrote:
> >> On Tue, 7 Oct 2025 at 03:40, Philippe Mathieu-Daudé
> >> <[email protected]> wrote:
> >>>
> >>> Convert max78000_gcr_ops[] to take MemTxAttrs and return MemTxResult,
> >>> allowing the write() path to return error on failure.
> >>
> >> *Should* it return a MEMTX error on this failure, though?
> >> This is a question of what the hardware behaviour is,
> >> and there's no reference to the datasheet in this
> >> commit message...
> >
> > Right. Thanks!
>
> Looking at "MAX78000 User Guide (UG7456; Rev 1; 3/2024)",
> chapter "4.7.2 RAM Zeroization" and table "4-67: Memory
> Zeroize Control Register", IIUC failure can not happen.
>
> Would that change be OK?
>
> -      address_space_write(&s->sram_as, SYSRAM0_START,
> -                          MEMTXATTRS_UNSPECIFIED, zero, 0x8000);
> +      /* RAM Zeroization can not fail */
> +      (void)address_space_write(&s->sram_as, SYSRAM0_START,
> +                                MEMTXATTRS_UNSPECIFIED, zero, 0x8000);

We don't generally use the void cast like that. Just
don't do anything with the return value.

-- PMM

Reply via email to