Skip to content

Commit 09b0939

Browse files
committed
Fix error of mixed declarations and code.
1 parent 2fc8263 commit 09b0939

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

recipes-kernel/kernel-modules/x8h7/x8h7_can.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define DRIVER_NAME "x8h7_can"
3131

3232
/* DEBUG HANDLING */
33-
// #define DEBUG
33+
#define DEBUG
3434
#include "debug.h"
3535
#ifdef DEBUG
3636
#define DBG_CAN_STATE(d, s) { \
@@ -531,6 +531,11 @@ static void x8h7_can_hw_rx(struct x8h7_can_priv *priv)
531531
static void x8h7_can_hw_tx(struct x8h7_can_priv *priv, struct can_frame *frame)
532532
{
533533
union x8h7_can_frame_message x8h7_can_msg;
534+
#ifdef DEBUG
535+
char data_str[X8H7_CAN_FRAME_MAX_DATA_LEN * 4] = {0};
536+
int i;
537+
int len;
538+
#endif
534539

535540
DBG_PRINT("\n");
536541

@@ -543,9 +548,7 @@ static void x8h7_can_hw_tx(struct x8h7_can_priv *priv, struct can_frame *frame)
543548
memcpy(x8h7_can_msg.field.data, frame->data, x8h7_can_msg.field.len);
544549

545550
#ifdef DEBUG
546-
char data_str[X8H7_CAN_FRAME_MAX_DATA_LEN * 4] = {0};
547-
int i = 0, len = 0;
548-
551+
i = 0; len = 0;
549552
for (i = 0; (i < frame->can_dlc) && (len < sizeof(data_str)); i++)
550553
{
551554
len += snprintf(data_str + len, sizeof(data_str) - len, " %02X", can_msg.field.data[i]);

0 commit comments

Comments
 (0)