Commit 14f0a0a4 authored by Markus Schneider-Pargmann's avatar Markus Schneider-Pargmann Committed by Marc Kleine-Budde

can: m_can: Use u32 for putidx

putidx is not an integer normally, it is an unsigned field used in
hardware registers. Use a u32 for it.
Signed-off-by: default avatarMarkus Schneider-Pargmann <msp@baylibre.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/all/20240207093220.2681425-9-msp@baylibre.comSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent e55b963e
...@@ -486,7 +486,7 @@ static void m_can_clean(struct net_device *net) ...@@ -486,7 +486,7 @@ static void m_can_clean(struct net_device *net)
struct m_can_classdev *cdev = netdev_priv(net); struct m_can_classdev *cdev = netdev_priv(net);
if (cdev->tx_skb) { if (cdev->tx_skb) {
int putidx = 0; u32 putidx = 0;
net->stats.tx_errors++; net->stats.tx_errors++;
if (cdev->version > 30) if (cdev->version > 30)
...@@ -1695,12 +1695,12 @@ static int m_can_close(struct net_device *dev) ...@@ -1695,12 +1695,12 @@ static int m_can_close(struct net_device *dev)
return 0; return 0;
} }
static int m_can_next_echo_skb_occupied(struct net_device *dev, int putidx) static int m_can_next_echo_skb_occupied(struct net_device *dev, u32 putidx)
{ {
struct m_can_classdev *cdev = netdev_priv(dev); struct m_can_classdev *cdev = netdev_priv(dev);
/*get wrap around for loopback skb index */ /*get wrap around for loopback skb index */
unsigned int wrap = cdev->can.echo_skb_max; unsigned int wrap = cdev->can.echo_skb_max;
int next_idx; u32 next_idx;
/* calculate next index */ /* calculate next index */
next_idx = (++putidx >= wrap ? 0 : putidx); next_idx = (++putidx >= wrap ? 0 : putidx);
...@@ -1719,7 +1719,7 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev) ...@@ -1719,7 +1719,7 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
u32 cccr, fdflags; u32 cccr, fdflags;
u32 txfqs; u32 txfqs;
int err; int err;
int putidx; u32 putidx;
cdev->tx_skb = NULL; cdev->tx_skb = NULL;
......
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