Skip to content

Commit bbb9297

Browse files
authored
Merge pull request #209 from bigbrett/release-quickfixes
macro protection and compiler warning fixes
2 parents 18f270b + 412d804 commit bbb9297

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

benchmark/bench_modules/wh_bench_mod_sha2.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ int _benchSha256(whClientContext* client, whBenchOpContext* ctx, int id,
5353
#if defined(WOLFHSM_CFG_DMA)
5454
if (devId == WH_DEV_ID_DMA) {
5555
inLen = WOLFHSM_CFG_BENCH_DMA_BUFFER_SIZE;
56+
57+
#if defined(WOLFHSM_CFG_TEST_POSIX)
5658
if (ctx->transportType == WH_BENCH_TRANSPORT_POSIX_DMA) {
5759
/* if static memory was used with DMA then use XMALLOC */
5860
void* heap =
@@ -68,7 +70,9 @@ int _benchSha256(whClientContext* client, whBenchOpContext* ctx, int id,
6870
return WH_ERROR_NOSPACE;
6971
}
7072
}
71-
else {
73+
else
74+
#endif /* WOLFHSM_CFG_TEST_POSIX */
75+
{
7276
in = WH_BENCH_DMA_BUFFER;
7377
}
7478
}
@@ -138,7 +142,7 @@ int _benchSha256(whClientContext* client, whBenchOpContext* ctx, int id,
138142
(void)wc_Sha256Free(sha256);
139143
}
140144

141-
#if defined(WOLFHSM_CFG_DMA)
145+
#if defined(WOLFHSM_CFG_DMA) && defined(WOLFHSM_CFG_TEST_POSIX)
142146
if (devId == WH_DEV_ID_DMA &&
143147
ctx->transportType == WH_BENCH_TRANSPORT_POSIX_DMA) {
144148
/* if static memory was used with DMA then use XFREE */

benchmark/config/wolfhsm_cfg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@
4343

4444
/* Benchmark configs */
4545
#define WOLFHSM_CFG_BENCH_ENABLE
46+
#define WOLFHSM_CFG_BENCH_MAIN
4647
#endif /* WOLFHSM_CFG_H_ */

benchmark/wh_bench_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "wh_bench_ops.h"
2222
#include "wh_bench_utils.h"
2323

24-
#if defined(WOLFHSM_CFG_BENCH_ENABLE)
24+
#if defined(WOLFHSM_CFG_BENCH_ENABLE) && defined(WOLFHSM_CFG_BENCH_MAIN)
2525

2626
#include <wolfssl/version.h>
2727
#include <string.h>
@@ -95,4 +95,4 @@ int main(int argc, char** argv)
9595
return 0;
9696
}
9797

98-
#endif /* WOLFHSM_CFG_BENCH_ENABLE */
98+
#endif /* WOLFHSM_CFG_BENCH_ENABLE && WOLFHSM_CFG_BENCH_MAIN */

0 commit comments

Comments
 (0)