Commit bbb5fb85 authored by Stephen Boyd's avatar Stephen Boyd Committed by Tzung-Bi Shih
Browse files

platform/chrome: cros_typec_switch: Remove impossible condition



The type of 'index' is unsigned long long, which can't possibly be less
than zero. Remove the impossible check.

Cc: Prashant Malani <pmalani@chromium.org>
Cc: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Acked-by: default avatarPrashant Malani <pmalani@chromium.org>
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220830225831.2362403-3-swboyd@chromium.org
parent 8dab6a59
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
			goto err_switch;
		}

		if (index < 0 || index >= EC_USB_PD_MAX_PORTS) {
		if (index >= EC_USB_PD_MAX_PORTS) {
			dev_err(fwnode->dev, "Invalid port index number: %llu\n", index);
			ret = -EINVAL;
			goto err_switch;