File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,6 @@ static void mcp2515_convert_canframe_to_mcp2515frame(const struct can_frame
202202{
203203 uint8_t rtr ;
204204 uint8_t dlc ;
205- uint8_t data_idx ;
206205
207206 if ((source -> flags & CAN_FRAME_IDE ) != 0 ) {
208207 target [MCP2515_FRAME_OFFSET_SIDH ] = source -> id >> 21 ;
@@ -223,7 +222,7 @@ static void mcp2515_convert_canframe_to_mcp2515frame(const struct can_frame
223222 target [MCP2515_FRAME_OFFSET_DLC ] = rtr | dlc ;
224223
225224 if (rtr == 0U ) {
226- for (data_idx = 0U ; data_idx < dlc ; data_idx ++ ) {
225+ for (uint8_t data_idx = 0U ; data_idx < dlc ; data_idx ++ ) {
227226 target [MCP2515_FRAME_OFFSET_D0 + data_idx ] =
228227 source -> data [data_idx ];
229228 }
@@ -233,8 +232,6 @@ static void mcp2515_convert_canframe_to_mcp2515frame(const struct can_frame
233232static void mcp2515_convert_mcp2515frame_to_canframe (const uint8_t * source ,
234233 struct can_frame * target )
235234{
236- uint8_t data_idx ;
237-
238235 memset (target , 0 , sizeof (* target ));
239236
240237 if (source [MCP2515_FRAME_OFFSET_SIDL ] & BIT (3 )) {
@@ -255,7 +252,7 @@ static void mcp2515_convert_mcp2515frame_to_canframe(const uint8_t *source,
255252 if ((source [MCP2515_FRAME_OFFSET_DLC ] & BIT (6 )) != 0 ) {
256253 target -> flags |= CAN_FRAME_RTR ;
257254 } else {
258- for (data_idx = 0U ; data_idx < target -> dlc ; data_idx ++ ) {
255+ for (uint8_t data_idx = 0U ; data_idx < target -> dlc ; data_idx ++ ) {
259256 target -> data [data_idx ] = source [MCP2515_FRAME_OFFSET_D0 +
260257 data_idx ];
261258 }
You can’t perform that action at this time.
0 commit comments