platform/chrome: cros_typec_switch: Remove impossible condition
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Aug 2022 22:58:29 +0000 (15:58 -0700)
committerTzung-Bi Shih <tzungbi@kernel.org>
Thu, 1 Sep 2022 02:15:34 +0000 (10:15 +0800)
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: Stephen Boyd <swboyd@chromium.org>
Acked-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220830225831.2362403-3-swboyd@chromium.org
drivers/platform/chrome/cros_typec_switch.c

index 383daf2c66b7caed5ce478ceb9557a19471cd562..3381d842c307b96380f3b64d8c6e2538dee7b9ec 100644 (file)
@@ -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;