/* Called when we're out of ideas and just want it all to end. */
static inline void elm327_hw_failure(struct elmcan *elm)
{
- struct can_frame frame = {0};
+ struct can_frame frame;
+ memset(&frame, 0, sizeof(frame));
frame.can_id = CAN_ERR_FLAG;
frame.can_dlc = CAN_ERR_DLC;
frame.data[5] = 'R';
static void elm327_parse_error(struct elmcan *elm, int len)
{
- struct can_frame frame = {0};
+ struct can_frame frame;
+ memset(&frame, 0, sizeof(frame));
frame.can_id = CAN_ERR_FLAG;
frame.can_dlc = CAN_ERR_DLC;
static int elm327_parse_frame(struct elmcan *elm, int len)
{
- struct can_frame frame = {0};
+ struct can_frame frame;
int hexlen;
int datastart;
int i;
+ memset(&frame, 0, sizeof(frame));
+
/* Find first non-hex and non-space character:
* - In the simplest case, there is none.
* - For RTR frames, 'R' is the first non-hex character.