Skip to content

Commit 8b4a532

Browse files
committed
Copilot fixes
1 parent 77c3380 commit 8b4a532

1 file changed

Lines changed: 11 additions & 23 deletions

File tree

test/wh_test_clientserver.c

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,30 +1365,19 @@ int whTest_ClientServerClientConfig(whClientConfig* clientCfg)
13651365
WH_TEST_ASSERT_RETURN(avail_objects == WOLFHSM_CFG_NVM_OBJECT_COUNT);
13661366

13671367
#ifdef WOLFHSM_CFG_DMA
1368-
{
1369-
/* Register DMA allow list for the buffers used in DMA NVM tests.
1370-
* static so the server's retained pointer remains valid */
1371-
static whNvmMetadata meta;
1372-
static whServerDmaAddrAllowList nvm_dma_allow;
1373-
memset(&meta, 0, sizeof(meta));
1374-
memset(&nvm_dma_allow, 0, sizeof(nvm_dma_allow));
1375-
nvm_dma_allow.readList[0].addr = send_buffer;
1376-
nvm_dma_allow.readList[0].size = sizeof(send_buffer);
1377-
nvm_dma_allow.readList[1].addr = &meta;
1378-
nvm_dma_allow.readList[1].size = sizeof(meta);
1379-
nvm_dma_allow.writeList[0].addr = recv_buffer;
1380-
nvm_dma_allow.writeList[0].size = sizeof(recv_buffer);
1381-
WH_TEST_RETURN_ON_FAIL(
1382-
wh_Server_DmaRegisterAllowList(server, &nvm_dma_allow));
1383-
1384-
/* Same writeback test, but with DMA */
1368+
/* Same writeback test, but with DMA.
1369+
* Note: this is a client-only test where the server runs separately,
1370+
* so we cannot register a DMA allow list here. The server must have
1371+
* its allow list configured externally. */
13851372
for (counter = 0; counter < 5; counter++) {
1373+
whNvmMetadata meta = {
1374+
.id = counter + 40,
1375+
.access = WH_NVM_ACCESS_ANY,
1376+
.flags = WH_NVM_FLAGS_NONE,
1377+
.len = 0,
1378+
.label = {0},
1379+
};
13861380
whNvmSize len = 0;
1387-
meta.id = counter + 40;
1388-
meta.access = WH_NVM_ACCESS_ANY;
1389-
meta.flags = WH_NVM_FLAGS_NONE;
1390-
meta.len = 0;
1391-
memset(meta.label, 0, sizeof(meta.label));
13921381

13931382
whNvmId gid = 0;
13941383
whNvmAccess gaccess = 0;
@@ -1493,7 +1482,6 @@ int whTest_ClientServerClientConfig(whClientConfig* clientCfg)
14931482
WH_TEST_ASSERT_RETURN(server_rc == WH_ERROR_OK);
14941483
WH_TEST_ASSERT_RETURN(avail_objects == WOLFHSM_CFG_NVM_OBJECT_COUNT);
14951484

1496-
} /* DMA allow list scope */
14971485
#endif /* WOLFHSM_CFG_DMA */
14981486

14991487
/* Test client counter API */

0 commit comments

Comments
 (0)