diff options
author | Vincent Mailhol <mailhol@kernel.org> | 2025-09-23 15:58:44 +0900 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2025-09-24 17:09:47 +0200 |
commit | 7de54546fff11cb0a53f47847d62f7b1a5792d17 (patch) | |
tree | e9212e051468f81c5962dda623beae78f872b29f /rust/helpers/xarray.c | |
parent | 6ffc1230d3a728e07d7d2464f388ad4bbefe90c2 (diff) |
can: dev: add can_get_ctrlmode_str()
In an effort to give more human readable messages when errors occur
because of conflicting options, it can be useful to convert the CAN
control mode flags into text.
Add a function which converts the first set CAN control mode into a
human readable string. The reason to only convert the first one is to
simplify edge cases: imagine that there are several invalid control
modes, we would just return the first invalid one to the user, thus
not having to handle complex string concatenation. The user can then
solve the first problem, call the netlink interface again and see the
next issue.
People who wish to enumerate all the control modes can still do so by,
for example, using this new function in a for_each_set_bit() loop.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250923-canxl-netlink-prep-v4-19-e720d28f66fe@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'rust/helpers/xarray.c')
0 files changed, 0 insertions, 0 deletions