From 0b7415f6d4db9b42300eec1740bcb5c1311fc247 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 22 Feb 2026 03:10:18 +0200 Subject: [PATCH] bdk: tsec: homogenize return values --- bdk/sec/tsec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bdk/sec/tsec.c b/bdk/sec/tsec.c index 405fae51..f79829b4 100644 --- a/bdk/sec/tsec.c +++ b/bdk/sec/tsec.c @@ -44,9 +44,9 @@ static int _tsec_dma_wait_idle() while (!(TSEC(TSEC_DMATRFCMD) & TSEC_DMATRFCMD_IDLE)) if (get_tmr_ms() > timeout) - return 0; + return 1; - return 1; + return 0; } static int _tsec_dma_pa_to_internal_100(int not_imem, int i_offset, int pa_offset) @@ -116,7 +116,7 @@ int tsec_query(void *tsec_keys, tsec_ctxt_t *tsec_ctxt) TSEC_IRQDEST_SWGEN0 | TSEC_IRQDEST_SWGEN1; TSEC(TSEC_ITFEN) = TSEC_ITFEN_CTXEN | TSEC_ITFEN_MTHDEN; - if (!_tsec_dma_wait_idle()) + if (_tsec_dma_wait_idle()) { res = -1; goto out; @@ -136,7 +136,7 @@ int tsec_query(void *tsec_keys, tsec_ctxt_t *tsec_ctxt) for (u32 addr = 0; addr < tsec_ctxt->size; addr += 0x100) { - if (!_tsec_dma_pa_to_internal_100(false, addr, addr)) + if (_tsec_dma_pa_to_internal_100(false, addr, addr)) { res = -2; goto out_free; @@ -257,7 +257,7 @@ int tsec_query(void *tsec_keys, tsec_ctxt_t *tsec_ctxt) } else { - if (!_tsec_dma_wait_idle()) + if (_tsec_dma_wait_idle()) { res = -3; goto out_free;