Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: ti_hecc: fix -Woverflow compiler warning

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>

authored by

Vincent Mailhol and committed by
Marc Kleine-Budde
7cae4d04 21e9b7d1

+1 -1
+1 -1
drivers/net/can/ti_hecc.c
··· 383 383 * overflows instead of the hardware silently dropping the 384 384 * messages. 385 385 */ 386 - mbx_mask = ~BIT(HECC_RX_LAST_MBOX); 386 + mbx_mask = ~BIT_U32(HECC_RX_LAST_MBOX); 387 387 hecc_write(priv, HECC_CANOPC, mbx_mask); 388 388 389 389 /* Enable interrupts */