diff options
author | Vincent Mailhol <mailhol.vincent@wanadoo.fr> | 2021-06-04 00:15:49 +0900 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-07-25 11:36:25 +0200 |
commit | 6b6bd199926797414bf4d6843312709dfd4a649e (patch) | |
tree | 2bcb58e1cabe9c0b63f2599089bc8a4663f87d07 /Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | |
parent | e3b0a4a470647bc48c186a71cc63ddcb93899424 (diff) | |
download | linux-6b6bd199926797414bf4d6843312709dfd4a649e.tar.gz |
can: netlink: remove redundant check in can_validate()
can_validate() does a first check:
| if (is_can_fd) {
| if (!data[IFLA_CAN_BITTIMING] || !data[IFLA_CAN_DATA_BITTIMING])
| return -EOPNOTSUPP;
| }
If that first if succeeds, we know that if is_can_fd is true then
data[IFLA_CAN_BITTIMING is set.
However, the next if switch does not leverage on above knowledge and
redoes the check:
| if (data[IFLA_CAN_DATA_BITTIMING]) {
| if (!is_can_fd || !data[IFLA_CAN_BITTIMING])
| ^~~~~~~~~~~~~~~~~~~~~~~~
| return -EOPNOTSUPP;
| }
This patch removes that redundant check.
Link: https://lore.kernel.org/r/20210603151550.140727-2-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'Documentation/devicetree/bindings/net/can/bosch,m_can.yaml')
0 files changed, 0 insertions, 0 deletions