Skip to content

Commit

Permalink
can: flexcan: replace open coded "mailbox code" by proper define
Browse files Browse the repository at this point in the history
This patch replaces a open coded variant of a "mailbox code" definition by an
existing define, improves code readability.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Marc Kleine-Budde committed May 6, 2015
1 parent 6f75fce commit 10d089b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/can/flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
FLEXCAN_IFLAG_BUF(FLEXCAN_TX_BUF_ID))

/* FLEXCAN message buffers */
#define FLEXCAN_MB_CNT_CODE(x) (((x) & 0xf) << 24)
#define FLEXCAN_MB_CODE_RX_INACTIVE (0x0 << 24)
#define FLEXCAN_MB_CODE_RX_EMPTY (0x4 << 24)
#define FLEXCAN_MB_CODE_RX_FULL (0x2 << 24)
Expand Down Expand Up @@ -478,7 +477,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct flexcan_regs __iomem *regs = priv->base;
struct can_frame *cf = (struct can_frame *)skb->data;
u32 can_id;
u32 ctrl = FLEXCAN_MB_CNT_CODE(0xc) | (cf->can_dlc << 16);
u32 ctrl = FLEXCAN_MB_CODE_TX_DATA | (cf->can_dlc << 16);

if (can_dropped_invalid_skb(dev, skb))
return NETDEV_TX_OK;
Expand Down

0 comments on commit 10d089b

Please sign in to comment.