]> 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)
commit67763e84d95c14123bea8be8e041756098374097
tree3658125e2ab79d022fe7a253270a1abcd06cdfac
parentbeeb42c965d34070aa55355d0d03acff2cefce6b
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