]> git.baikalelectronics.ru Git - kernel.git/commit
can: mcp251xfd: ring: mcp251xfd_ring_init(): checked RAM usage of ring setup
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 3 Aug 2021 14:32:01 +0000 (16:32 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 24 Feb 2022 07:46:59 +0000 (08:46 +0100)
commitfa0b68df7c95043685f339cf27d2539c001a21fd
tree3658125e2ab79d022fe7a253270a1abcd06cdfac
parent62713f0d9a38f2e0b772e6448adfa9c405316237
can: mcp251xfd: ring: mcp251xfd_ring_init(): checked RAM usage of ring setup

With this patch the usage of the on-chip RAM is checked. In the
current driver the FIFO setup is fixed and always fits into the RAM.

With an upcoming patch series the ring and FIFO setup will be more
dynamic. Although using more RAM than available should not happen, but
add this safety check, just in case.

Link: https://lore.kernel.org/all/20220217103826.2299157-6-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c
drivers/net/can/spi/mcp251xfd/mcp251xfd.h