cangen: remove local assignment of Classical CAN frame pointer

As we have introduced struct can_frame *ccf = (struct can_frame *)&frame;
on top level we can remove this local assignment inside the if statement.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/260/head
Oliver Hartkopp 2020-11-01 16:51:40 +01:00
parent 0b6af299d1
commit a23eb24f95
1 changed files with 3 additions and 5 deletions

View File

@ -423,12 +423,10 @@ int main(int argc, char **argv)
frame.len = random() & 0xF;
if (frame.len > CAN_MAX_DLEN) {
if (len8_dlc) {
struct can_frame *ccf = (struct can_frame *)&frame;
/* generate Classic CAN len8 DLCs */
/* generate Classic CAN len8 DLCs? */
if (len8_dlc)
ccf->len8_dlc = frame.len;
}
frame.len = 8; /* for about 50% of the frames */
}
}