Skip to content

Commit

Permalink
can: peak_usb: pcan_usb_encode_msg(): add information
Browse files Browse the repository at this point in the history
This patch adds information by replacing a hard-coded values with its
symbol and a adding comment.

Link: https://lore.kernel.org/r/20210625130931.27438-5-s.grosjean@peak-system.com
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Stephane Grosjean authored and Marc Kleine-Budde committed Jul 25, 2021
1 parent 3a79394 commit 1763c54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/can/usb/peak_usb/pcan_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

#define PCAN_USB_MSG_HEADER_LEN 2

#define PCAN_USB_MSG_TX_CAN 2 /* Tx msg is a CAN frame */

/* PCAN-USB adapter internal clock (MHz) */
#define PCAN_USB_CRYSTAL_HZ 16000000

Expand Down Expand Up @@ -834,8 +836,8 @@ static int pcan_usb_encode_msg(struct peak_usb_device *dev, struct sk_buff *skb,
u32 can_id_flags = cf->can_id & CAN_ERR_MASK;
u8 *pc;

obuf[0] = 2;
obuf[1] = 1;
obuf[0] = PCAN_USB_MSG_TX_CAN;
obuf[1] = 1; /* only one CAN frame is stored in the packet */

pc = obuf + PCAN_USB_MSG_HEADER_LEN;

Expand Down

0 comments on commit 1763c54

Please sign in to comment.