| From ee60c5bc576e37eb373d77c20195dac718dc2f23 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Tue, 15 Jul 2025 20:28:11 +0900 |
| Subject: can: ti_hecc: fix -Woverflow compiler warning |
| |
| From: Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
| |
| [ Upstream commit 7cae4d04717b002cffe41169da3f239c845a0723 ] |
| |
| Fix below default (W=0) warning: |
| |
| drivers/net/can/ti_hecc.c: In function 'ti_hecc_start': |
| drivers/net/can/ti_hecc.c:386:20: warning: conversion from 'long unsigned int' to 'u32' {aka 'unsigned int'} changes value from '18446744073709551599' to '4294967279' [-Woverflow] |
| 386 | mbx_mask = ~BIT(HECC_RX_LAST_MBOX); |
| | ^ |
| |
| Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
| Link: https://patch.msgid.link/20250715-can-compile-test-v2-1-f7fd566db86f@wanadoo.fr |
| Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/net/can/ti_hecc.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c |
| index 644e8b8eb91e..e6d6661a908a 100644 |
| --- a/drivers/net/can/ti_hecc.c |
| +++ b/drivers/net/can/ti_hecc.c |
| @@ -383,7 +383,7 @@ static void ti_hecc_start(struct net_device *ndev) |
| * overflows instead of the hardware silently dropping the |
| * messages. |
| */ |
| - mbx_mask = ~BIT(HECC_RX_LAST_MBOX); |
| + mbx_mask = ~BIT_U32(HECC_RX_LAST_MBOX); |
| hecc_write(priv, HECC_CANOPC, mbx_mask); |
| |
| /* Enable interrupts */ |
| -- |
| 2.39.5 |
| |