memorystress:Fix some warnings and make the index randomized.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2023-08-03 22:17:30 +08:00 committed by Xiang Xiao
parent 4a78dedbae
commit 5645b82b74

View File

@ -23,6 +23,7 @@
****************************************************************************/
#include <nuttx/config.h>
#include <stdlib.h>
#include <debug.h>
#include <stdio.h>
#include <stddef.h>
@ -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;