realtek: Add missing case in switch statement
authorRafał Mikrut <mikrutrafal@protonmail.com>
Tue, 8 Dec 2020 21:01:14 +0000 (22:01 +0100)
committerPetr Štetiar <ynezz@true.cz>
Fri, 11 Dec 2020 12:48:24 +0000 (13:48 +0100)
Cppcheck shows here duplicated break.

Code `state->speed = SPEED_1000;` will be never executed because above
it there is break statement.

Almost identical statement is placed in another realtek driver
https://github.com/openwrt/openwrt/blob/18a53d43d646290053eff4736ec852efcf6bf510/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c#L286-L294

Signed-off-by: Rafał Mikrut <mikrutrafal@protonmail.com>
target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c

index d53d5dec12731c3aa6460314a9bdef74eefe9aa8..fec842674e07619e9abb051f43f23375e76709b3 100644 (file)
@@ -986,6 +986,7 @@ static int rtl838x_mac_pcs_get_state(struct phylink_config *config,
        case 1:
                state->speed = SPEED_100;
                break;
+       case 2:
                state->speed = SPEED_1000;
                break;
        default: