]> 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)
commitdfb50a2e5b5fd1b258d3c4a4a5409c3d6ff48589
tree3658125e2ab79d022fe7a253270a1abcd06cdfac
parent783136b76a4f1e7860c8ce032c97ad5e2ab3a278
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