diff options
| author | Vincent Mailhol <mailhol@kernel.org> | 2025-09-23 15:58:29 +0900 |
|---|---|---|
| committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2025-09-24 17:09:44 +0200 |
| commit | f5ae5a75412db0b8ded2342d409c7ba504eb198f (patch) | |
| tree | 157ad0b421e2c7e7a7845645c38c51e2a7f514ff /rust/helpers/platform.c | |
| parent | 94040a8f484576cb1b7df3b2e93118c3b3e3aff4 (diff) | |
can: netlink: refactor can_validate_bittiming()
Whenever can_validate_bittiming() is called, it is always preceded by
some boilerplate code which was copy pasted all over the place. Move
that repeated code directly inside can_validate_bittiming().
Finally, the mempcy() is not needed: the nla attributes are four bytes
aligned which is just enough for struct can_bittiming. Add a
static_assert() to document that the alignment is correct and just use
the pointer returned by nla_data() as-is.
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250923-canxl-netlink-prep-v4-4-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
