Skip to content

Commit 14f0a0a

Browse files
scosumarckleinebudde
authored andcommitted
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: Markus Schneider-Pargmann <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent e55b963 commit 14f0a0a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/can/m_can/m_can.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static void m_can_clean(struct net_device *net)
486486
struct m_can_classdev *cdev = netdev_priv(net);
487487

488488
if (cdev->tx_skb) {
489-
int putidx = 0;
489+
u32 putidx = 0;
490490

491491
net->stats.tx_errors++;
492492
if (cdev->version > 30)
@@ -1695,12 +1695,12 @@ static int m_can_close(struct net_device *dev)
16951695
return 0;
16961696
}
16971697

1698-
static int m_can_next_echo_skb_occupied(struct net_device *dev, int putidx)
1698+
static int m_can_next_echo_skb_occupied(struct net_device *dev, u32 putidx)
16991699
{
17001700
struct m_can_classdev *cdev = netdev_priv(dev);
17011701
/*get wrap around for loopback skb index */
17021702
unsigned int wrap = cdev->can.echo_skb_max;
1703-
int next_idx;
1703+
u32 next_idx;
17041704

17051705
/* calculate next index */
17061706
next_idx = (++putidx >= wrap ? 0 : putidx);
@@ -1719,7 +1719,7 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
17191719
u32 cccr, fdflags;
17201720
u32 txfqs;
17211721
int err;
1722-
int putidx;
1722+
u32 putidx;
17231723

17241724
cdev->tx_skb = NULL;
17251725

0 commit comments

Comments
 (0)