Commit d38f9180 authored by Appana Durga Kedareswara rao's avatar Appana Durga Kedareswara rao Committed by Marc Kleine-Budde

can: xilinx_can: Fix style issues

This patch fixes below checkpatch warnings and checks in the driver.

CHECK: Alignment should match open parenthesis
+       void (*write_reg)(const struct xcan_priv *priv, enum xcan_reg reg,
+                       u32 val);

CHECK: Alignment should match open parenthesis
+static void xcan_write_reg_le(const struct xcan_priv *priv, enum xcan_reg reg,
+                       u32 val)

CHECK: Alignment should match open parenthesis
+static void xcan_write_reg_be(const struct xcan_priv *priv, enum xcan_reg reg,
+                       u32 val)

CHECK: Alignment should match open parenthesis
+       netdev_dbg(ndev, "BRPR=0x%08x, BTR=0x%08x\n",
+                       priv->read_reg(priv, XCAN_BRPR_OFFSET),

CHECK: Alignment should match open parenthesis
+                       netdev_warn(ndev,
+                               "timed out for correct mode\n");

CHECK: Alignment should match open parenthesis
+       netdev_dbg(ndev, "status:#x%08x\n",
+                       priv->read_reg(priv, XCAN_SR_OFFSET));

CHECK: spaces preferred around that '-' (ctx:VxV)
+                       (CAN_EFF_ID_BITS-CAN_SFF_ID_BITS)) <<
                                        ^

CHECK: Alignment should match open parenthesis
+       netdev_dbg(ndev, "%s: error status register:0x%x\n",
+                       __func__, priv->read_reg(priv, XCAN_ESR_OFFSET));

WARNING: line over 80 characters
+                       offset = XCAN_RXMSG_2_FRAME_OFFSET(fsr & XCAN_FSR_RI_MASK);

WARNING: line over 80 characters
+                       offset = XCAN_RXMSG_FRAME_OFFSET(fsr & XCAN_FSR_RI_MASK);

WARNING: line over 80 characters
+               while ((isr & XCAN_IXR_TXOK_MASK) && !WARN_ON(++retries == 100)) {

WARNING: line over 80 characters
+                       priv->write_reg(priv, XCAN_ICR_OFFSET, XCAN_IXR_TXOK_MASK);

CHECK: Alignment should match open parenthesis
+               netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
+                               __func__, ret);

CHECK: Alignment should match open parenthesis
+       ret = request_irq(ndev->irq, xcan_interrupt, priv->irq_flags,
+                       ndev->name, ndev);

CHECK: Alignment should match open parenthesis
+static int xcan_get_berr_counter(const struct net_device *ndev,
+                                       struct can_berr_counter *bec)

CHECK: Alignment should match open parenthesis
+               netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
+                               __func__, ret);

CHECK: Please don't use multiple blank lines
+
+

CHECK: Alignment should match open parenthesis
+               netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
+                       __func__, ret);`
Signed-off-by: default avatarAppana Durga Kedareswara rao <appana.durga.rao@xilinx.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 5443c226
...@@ -498,7 +498,7 @@ static void xcan_write_frame(struct xcan_priv *priv, struct sk_buff *skb, ...@@ -498,7 +498,7 @@ static void xcan_write_frame(struct xcan_priv *priv, struct sk_buff *skb,
id = ((cf->can_id & CAN_EFF_MASK) << XCAN_IDR_ID2_SHIFT) & id = ((cf->can_id & CAN_EFF_MASK) << XCAN_IDR_ID2_SHIFT) &
XCAN_IDR_ID2_MASK; XCAN_IDR_ID2_MASK;
id |= (((cf->can_id & CAN_EFF_MASK) >> id |= (((cf->can_id & CAN_EFF_MASK) >>
(CAN_EFF_ID_BITS-CAN_SFF_ID_BITS)) << (CAN_EFF_ID_BITS - CAN_SFF_ID_BITS)) <<
XCAN_IDR_ID1_SHIFT) & XCAN_IDR_ID1_MASK; XCAN_IDR_ID1_SHIFT) & XCAN_IDR_ID1_MASK;
/* The substibute remote TX request bit should be "1" /* The substibute remote TX request bit should be "1"
...@@ -982,9 +982,11 @@ static int xcan_rx_fifo_get_next_frame(struct xcan_priv *priv) ...@@ -982,9 +982,11 @@ static int xcan_rx_fifo_get_next_frame(struct xcan_priv *priv)
return -ENOENT; return -ENOENT;
if (priv->devtype.flags & XCAN_FLAG_CANFD_2) if (priv->devtype.flags & XCAN_FLAG_CANFD_2)
offset = XCAN_RXMSG_2_FRAME_OFFSET(fsr & XCAN_FSR_RI_MASK); offset =
XCAN_RXMSG_2_FRAME_OFFSET(fsr & XCAN_FSR_RI_MASK);
else else
offset = XCAN_RXMSG_FRAME_OFFSET(fsr & XCAN_FSR_RI_MASK); offset =
XCAN_RXMSG_FRAME_OFFSET(fsr & XCAN_FSR_RI_MASK);
} else { } else {
/* check if RX FIFO is empty */ /* check if RX FIFO is empty */
...@@ -1094,8 +1096,10 @@ static void xcan_tx_interrupt(struct net_device *ndev, u32 isr) ...@@ -1094,8 +1096,10 @@ static void xcan_tx_interrupt(struct net_device *ndev, u32 isr)
* via TXFEMP handling as we read TXFEMP *after* TXOK * via TXFEMP handling as we read TXFEMP *after* TXOK
* clear to satisfy (1). * clear to satisfy (1).
*/ */
while ((isr & XCAN_IXR_TXOK_MASK) && !WARN_ON(++retries == 100)) { while ((isr & XCAN_IXR_TXOK_MASK) &&
priv->write_reg(priv, XCAN_ICR_OFFSET, XCAN_IXR_TXOK_MASK); !WARN_ON(++retries == 100)) {
priv->write_reg(priv, XCAN_ICR_OFFSET,
XCAN_IXR_TXOK_MASK);
isr = priv->read_reg(priv, XCAN_ISR_OFFSET); isr = priv->read_reg(priv, XCAN_ISR_OFFSET);
} }
...@@ -1305,7 +1309,6 @@ static int xcan_get_berr_counter(const struct net_device *ndev, ...@@ -1305,7 +1309,6 @@ static int xcan_get_berr_counter(const struct net_device *ndev,
return 0; return 0;
} }
static const struct net_device_ops xcan_netdev_ops = { static const struct net_device_ops xcan_netdev_ops = {
.ndo_open = xcan_open, .ndo_open = xcan_open,
.ndo_stop = xcan_close, .ndo_stop = xcan_close,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment