tests: canbus: isotp: conformance: fix global variable usage

Even though it was leading to the same result, the function should use
its parameter and not the global variable for desired frames.

Signed-off-by: Martin Jäger <martin@libre.solar>
This commit is contained in:
Martin Jäger 2023-09-07 12:03:16 +02:00 committed by Carles Cufí
commit ef77fe3402

View file

@ -372,7 +372,7 @@ static void prepare_cf_frames(struct frame_desired *frames, size_t frames_cnt,
for (i = 0; i < frames_cnt && remaining_length; i++) {
frames[i].data[0] = CF_PCI_BYTE_1 | ((i+1) & 0x0F);
frames[i].length = TX_DL;
memcpy(&des_frames[i].data[1], data_ptr, DATA_SIZE_CF);
memcpy(&frames[i].data[1], data_ptr, DATA_SIZE_CF);
if (remaining_length < DATA_SIZE_CF) {
if ((IS_ENABLED(CONFIG_ISOTP_ENABLE_TX_PADDING) && tx) ||
@ -380,7 +380,7 @@ static void prepare_cf_frames(struct frame_desired *frames, size_t frames_cnt,
uint8_t padded_dlc = can_bytes_to_dlc(MAX(8, remaining_length + 1));
uint8_t padded_len = can_dlc_to_bytes(padded_dlc);
memset(&des_frames[i].data[remaining_length + 1], 0xCC,
memset(&frames[i].data[remaining_length + 1], 0xCC,
padded_len - remaining_length - 1);
frames[i].length = padded_len;
} else {