From 5645b82b741f1349585d81fa71f3db6863f6cb3c Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Thu, 3 Aug 2023 22:17:30 +0800 Subject: [PATCH] memorystress:Fix some warnings and make the index randomized. Signed-off-by: chenrun1 --- system/memstress/memorystress_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/memstress/memorystress_main.c b/system/memstress/memorystress_main.c index 802b1b528..2e83bd45c 100644 --- a/system/memstress/memorystress_main.c +++ b/system/memstress/memorystress_main.c @@ -23,6 +23,7 @@ ****************************************************************************/ #include +#include #include #include #include @@ -224,7 +225,7 @@ static bool memorystress_iter(FAR struct memorystress_context_s *context) bool debug = context->debug; size_t index; - index = randnum(context->config->nodelen, &seed); + index = rand() % (context->config->nodelen - 1); node = &(context->node_array[index]); func = (FAR struct memorystress_func_s *)context->config->func;