diff options
| author | Vincent Mailhol <mailhol@kernel.org> | 2025-09-23 15:58:32 +0900 |
|---|---|---|
| committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2025-09-24 17:09:44 +0200 |
| commit | 45be26b7e35a70ac7c79341747bd596d83dee977 (patch) | |
| tree | 9dbe6994023a50574e589cb9a03693c2f93aafd2 /rust/helpers/platform.c | |
| parent | 3820a415bece1feb7d832f6bda6c927d91c3ab52 (diff) | |
can: netlink: refactor CAN_CTRLMODE_TDC_{AUTO,MANUAL} flag reset logic
CAN_CTRLMODE_TDC_AUTO and CAN_CTRLMODE_TDC_MANUAL are mutually
exclusive. This means that whenever the user switches from auto to
manual mode (or vice versa), the other flag which was set previously
needs to be cleared.
Currently, this is handled with a masking operation. It can be done in
a simpler manner by clearing any of the previous TDC flags before
copying netlink attributes. The code becomes easier to understand and
will make it easier to add the new upcoming CAN XL flags which will
have a similar reset logic as the current TDC flags.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250923-canxl-netlink-prep-v4-7-e720d28f66fe@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'rust/helpers/platform.c')
0 files changed, 0 insertions, 0 deletions
