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
...@@ -183,7 +183,7 @@ struct xcan_priv { ...@@ -183,7 +183,7 @@ struct xcan_priv {
struct napi_struct napi; struct napi_struct napi;
u32 (*read_reg)(const struct xcan_priv *priv, enum xcan_reg reg); u32 (*read_reg)(const struct xcan_priv *priv, enum xcan_reg reg);
void (*write_reg)(const struct xcan_priv *priv, enum xcan_reg reg, void (*write_reg)(const struct xcan_priv *priv, enum xcan_reg reg,
u32 val); u32 val);
struct device *dev; struct device *dev;
void __iomem *reg_base; void __iomem *reg_base;
unsigned long irq_flags; unsigned long irq_flags;
...@@ -238,7 +238,7 @@ static const struct can_bittiming_const xcan_bittiming_const_canfd2 = { ...@@ -238,7 +238,7 @@ static const struct can_bittiming_const xcan_bittiming_const_canfd2 = {
* Write data to the paricular CAN register * Write data to the paricular CAN register
*/ */
static void xcan_write_reg_le(const struct xcan_priv *priv, enum xcan_reg reg, static void xcan_write_reg_le(const struct xcan_priv *priv, enum xcan_reg reg,
u32 val) u32 val)
{ {
iowrite32(val, priv->reg_base + reg); iowrite32(val, priv->reg_base + reg);
} }
...@@ -265,7 +265,7 @@ static u32 xcan_read_reg_le(const struct xcan_priv *priv, enum xcan_reg reg) ...@@ -265,7 +265,7 @@ static u32 xcan_read_reg_le(const struct xcan_priv *priv, enum xcan_reg reg)
* Write data to the paricular CAN register * Write data to the paricular CAN register
*/ */
static void xcan_write_reg_be(const struct xcan_priv *priv, enum xcan_reg reg, static void xcan_write_reg_be(const struct xcan_priv *priv, enum xcan_reg reg,
u32 val) u32 val)
{ {
iowrite32be(val, priv->reg_base + reg); iowrite32be(val, priv->reg_base + reg);
} }
...@@ -373,8 +373,8 @@ static int xcan_set_bittiming(struct net_device *ndev) ...@@ -373,8 +373,8 @@ static int xcan_set_bittiming(struct net_device *ndev)
priv->write_reg(priv, XCAN_BTR_OFFSET, btr1); priv->write_reg(priv, XCAN_BTR_OFFSET, btr1);
netdev_dbg(ndev, "BRPR=0x%08x, BTR=0x%08x\n", netdev_dbg(ndev, "BRPR=0x%08x, BTR=0x%08x\n",
priv->read_reg(priv, XCAN_BRPR_OFFSET), priv->read_reg(priv, XCAN_BRPR_OFFSET),
priv->read_reg(priv, XCAN_BTR_OFFSET)); priv->read_reg(priv, XCAN_BTR_OFFSET));
return 0; return 0;
} }
...@@ -439,12 +439,12 @@ static int xcan_chip_start(struct net_device *ndev) ...@@ -439,12 +439,12 @@ static int xcan_chip_start(struct net_device *ndev)
while (!(priv->read_reg(priv, XCAN_SR_OFFSET) & reg_sr_mask)) { while (!(priv->read_reg(priv, XCAN_SR_OFFSET) & reg_sr_mask)) {
if (time_after(jiffies, timeout)) { if (time_after(jiffies, timeout)) {
netdev_warn(ndev, netdev_warn(ndev,
"timed out for correct mode\n"); "timed out for correct mode\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
} }
netdev_dbg(ndev, "status:#x%08x\n", netdev_dbg(ndev, "status:#x%08x\n",
priv->read_reg(priv, XCAN_SR_OFFSET)); priv->read_reg(priv, XCAN_SR_OFFSET));
priv->can.state = CAN_STATE_ERROR_ACTIVE; priv->can.state = CAN_STATE_ERROR_ACTIVE;
return 0; return 0;
...@@ -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"
...@@ -934,7 +934,7 @@ static void xcan_err_interrupt(struct net_device *ndev, u32 isr) ...@@ -934,7 +934,7 @@ static void xcan_err_interrupt(struct net_device *ndev, u32 isr)
} }
netdev_dbg(ndev, "%s: error status register:0x%x\n", netdev_dbg(ndev, "%s: error status register:0x%x\n",
__func__, priv->read_reg(priv, XCAN_ESR_OFFSET)); __func__, priv->read_reg(priv, XCAN_ESR_OFFSET));
} }
/** /**
...@@ -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);
} }
...@@ -1208,12 +1212,12 @@ static int xcan_open(struct net_device *ndev) ...@@ -1208,12 +1212,12 @@ static int xcan_open(struct net_device *ndev)
ret = pm_runtime_get_sync(priv->dev); ret = pm_runtime_get_sync(priv->dev);
if (ret < 0) { if (ret < 0) {
netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n", netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
__func__, ret); __func__, ret);
return ret; return ret;
} }
ret = request_irq(ndev->irq, xcan_interrupt, priv->irq_flags, ret = request_irq(ndev->irq, xcan_interrupt, priv->irq_flags,
ndev->name, ndev); ndev->name, ndev);
if (ret < 0) { if (ret < 0) {
netdev_err(ndev, "irq allocation for CAN failed\n"); netdev_err(ndev, "irq allocation for CAN failed\n");
goto err; goto err;
...@@ -1284,7 +1288,7 @@ static int xcan_close(struct net_device *ndev) ...@@ -1284,7 +1288,7 @@ static int xcan_close(struct net_device *ndev)
* Return: 0 on success and failure value on error * Return: 0 on success and failure value on error
*/ */
static int xcan_get_berr_counter(const struct net_device *ndev, static int xcan_get_berr_counter(const struct net_device *ndev,
struct can_berr_counter *bec) struct can_berr_counter *bec)
{ {
struct xcan_priv *priv = netdev_priv(ndev); struct xcan_priv *priv = netdev_priv(ndev);
int ret; int ret;
...@@ -1292,7 +1296,7 @@ static int xcan_get_berr_counter(const struct net_device *ndev, ...@@ -1292,7 +1296,7 @@ static int xcan_get_berr_counter(const struct net_device *ndev,
ret = pm_runtime_get_sync(priv->dev); ret = pm_runtime_get_sync(priv->dev);
if (ret < 0) { if (ret < 0) {
netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n", netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
__func__, ret); __func__, ret);
return ret; return ret;
} }
...@@ -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,
...@@ -1589,7 +1592,7 @@ static int xcan_probe(struct platform_device *pdev) ...@@ -1589,7 +1592,7 @@ static int xcan_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) { if (ret < 0) {
netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n", netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
__func__, ret); __func__, ret);
goto err_pmdisable; goto err_pmdisable;
} }
......
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