On 2/7/24 08:20, del...@kernel.org wrote:
@@ -610,6 +607,7 @@ static MemTxResult astro_chip_write_with_attrs(void 
*opaque, hwaddr addr,
                                                uint64_t val, unsigned size,
                                                MemTxAttrs attrs)
  {
+    MemTxResult ret = MEMTX_OK;
      AstroState *s = opaque;
trace_astro_chip_write(addr, size, val);
@@ -686,11 +684,9 @@ static MemTxResult astro_chip_write_with_attrs(void 
*opaque, hwaddr addr,
  #undef EMPTY_PORT
default:
-        /* Controlled by astro_chip_mem_valid above.  */
-        trace_astro_chip_write(addr, size, val);
-        g_assert_not_reached();
+        ret = MEMTX_DECODE_ERROR;
      }
-    return MEMTX_OK;
+    return ret;
  }

For writes it's cleaner to just return these values directly than introduce a 
local.
Unlike reads, were you still want to go through the tracepoint on the way out.

Otherwise,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~



Reply via email to