I have a general programming question regarding which is a better implementation, switch or if. For example, which of the following is a better implementation, especially at kernel level and driver module level:-
Scenario 1 –
Scenario 2 –
if (key == A)
if (key == B)
Also, is nested switch statements a good practise? I can implement separate functions to avoid nested switch statements but worried about function calling overhead costs.