]> git.baikalelectronics.ru Git - kernel.git/commit
can: dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode()
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Mon, 13 Dec 2021 16:02:23 +0000 (01:02 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 5 Jan 2022 11:09:05 +0000 (12:09 +0100)
commit603a8b1d8c7dfeb20f43d9d79c14ed8adb8d3174
tree962a9dc1e7a578387eebabf452d439bb7d3feead
parentb01d5543f78d0e027ec45a97e95ce07b2ecda0a1
can: dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode()

The statically enabled features of a CAN controller can be retrieved
using below formula:

| u32 ctrlmode_static = priv->ctrlmode & ~priv->ctrlmode_supported;

As such, there is no need to store this information. This patch remove
the field ctrlmode_static of struct can_priv and provides, in
replacement, the inline function can_get_static_ctrlmode() which
returns the same value.

Link: https://lore.kernel.org/all/20211213160226.56219-2-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev/dev.c
drivers/net/can/dev/netlink.c
include/linux/can/dev.h