From fa1c92896134bf16b94c8dc607b0c7fd15abf647 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Tue, 11 Jun 2019 01:10:45 -0700 Subject: [PATCH] Fix Misra 13.4 on safety code --- board/safety.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/safety.h b/board/safety.h index 98b4f66f6..3afb39cb1 100644 --- a/board/safety.h +++ b/board/safety.h @@ -166,7 +166,8 @@ void update_sample(struct sample_t *sample, int sample_new) { sample->values[0] = sample_new; // get the minimum and maximum measured samples - sample->min = sample->max = sample->values[0]; + sample->min = sample->values[0]; + sample->max = sample->values[0]; for (int i = 1; i < sizeof(sample->values)/sizeof(sample->values[0]); i++) { if (sample->values[i] < sample->min) { sample->min = sample->values[i];