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
202
202
{
203
203
uint8_t rtr ;
204
204
uint8_t dlc ;
205
- uint8_t data_idx ;
206
205
207
206
if ((source -> flags & CAN_FRAME_IDE ) != 0 ) {
208
207
target [MCP2515_FRAME_OFFSET_SIDH ] = source -> id >> 21 ;
@@ -223,7 +222,7 @@ static void mcp2515_convert_canframe_to_mcp2515frame(const struct can_frame
223
222
target [MCP2515_FRAME_OFFSET_DLC ] = rtr | dlc ;
224
223
225
224
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 ++ ) {
227
226
target [MCP2515_FRAME_OFFSET_D0 + data_idx ] =
228
227
source -> data [data_idx ];
229
228
}
@@ -233,8 +232,6 @@ static void mcp2515_convert_canframe_to_mcp2515frame(const struct can_frame
233
232
static void mcp2515_convert_mcp2515frame_to_canframe (const uint8_t * source ,
234
233
struct can_frame * target )
235
234
{
236
- uint8_t data_idx ;
237
-
238
235
memset (target , 0 , sizeof (* target ));
239
236
240
237
if (source [MCP2515_FRAME_OFFSET_SIDL ] & BIT (3 )) {
@@ -255,7 +252,7 @@ static void mcp2515_convert_mcp2515frame_to_canframe(const uint8_t *source,
255
252
if ((source [MCP2515_FRAME_OFFSET_DLC ] & BIT (6 )) != 0 ) {
256
253
target -> flags |= CAN_FRAME_RTR ;
257
254
} 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 ++ ) {
259
256
target -> data [data_idx ] = source [MCP2515_FRAME_OFFSET_D0 +
260
257
data_idx ];
261
258
}
You can’t perform that action at this time.
0 commit comments