Skip to content

Commit d5f07eb

Browse files
henrikbrixandersenkartben
authored andcommitted
drivers: can: common: terminate if ... else if ... constructs with else
Terminate "if ... else if ..." constructs with an empty "else" clause to indicate that consideration has been given regarding the behaviour when all other conditions evaluate to false. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
1 parent 404d92d commit d5f07eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/can/can_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ static int update_sample_pnt(uint32_t total_tq, uint32_t sample_pnt, struct can_
183183
if (tseg2 < min->phase_seg2) {
184184
return -ENOTSUP;
185185
}
186+
} else {
187+
/* Sample point location within range */
186188
}
187189

188190
res->phase_seg2 = tseg2;
@@ -199,6 +201,8 @@ static int update_sample_pnt(uint32_t total_tq, uint32_t sample_pnt, struct can_
199201
/* Even tseg1 distribution not possible, increase phase_seg1 */
200202
res->phase_seg1 = min->phase_seg1;
201203
res->prop_seg = tseg1 - res->phase_seg1;
204+
} else {
205+
/* No redistribution necessary */
202206
}
203207

204208
/* Calculate the resulting sample point */

0 commit comments

Comments
 (0)