Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more efficient code, c_can.c #295

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions drivers/net/can/c_can/c_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,9 @@ static int c_can_handle_state_change(struct net_device *dev,
cf->data[1] = (bec.txerr > bec.rxerr) ?
CAN_ERR_CRTL_TX_WARNING :
CAN_ERR_CRTL_RX_WARNING;
cf->data[6] = bec.txerr;
cf->data[7] = bec.rxerr;
cf->data[6] = bec.txerr;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

902

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

902



break;
case C_CAN_ERROR_PASSIVE:
Expand All @@ -909,9 +910,9 @@ static int c_can_handle_state_change(struct net_device *dev,
cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
if (bec.txerr > 127)
cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE;

cf->data[6] = bec.txerr;
cf->data[7] = bec.rxerr;
cf->data[6] = bec.txerr;

break;
case C_CAN_BUS_OFF:
/* bus-off state */
Expand Down