[PATCH 5.15 292/917] can: bittiming: can_fixup_bittiming(): change type of tseg1 and alltseg to unsigned int
From: Greg Kroah-Hartman
Date: Mon Nov 15 2021 - 19:57:27 EST
From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
[ Upstream commit e346290439609a8ac67122418ca2efbad8d0a7e7 ]
All timing calculation is done with unsigned integers, so change type
of tseg1 and alltseg to unsigned int, too.
Link: https://lore.kernel.org/all/20211013130653.1513627-1-mkl@xxxxxxxxxxxxxx
Link: https://github.com/linux-can/can-utils/pull/314
Reported-by: Gary Bisson <bisson.gary@xxxxxxxxx>
Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/net/can/dev/bittiming.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/dev/bittiming.c b/drivers/net/can/dev/bittiming.c
index f49170eadd547..b1b5a82f08299 100644
--- a/drivers/net/can/dev/bittiming.c
+++ b/drivers/net/can/dev/bittiming.c
@@ -209,7 +209,7 @@ static int can_fixup_bittiming(struct net_device *dev, struct can_bittiming *bt,
const struct can_bittiming_const *btc)
{
struct can_priv *priv = netdev_priv(dev);
- int tseg1, alltseg;
+ unsigned int tseg1, alltseg;
u64 brp64;
tseg1 = bt->prop_seg + bt->phase_seg1;
--
2.33.0