summaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome
diff options
context:
space:
mode:
authorStephen Boyd <swboyd@chromium.org>2022-08-30 15:58:29 -0700
committerTzung-Bi Shih <tzungbi@kernel.org>2022-09-01 10:15:34 +0800
commitbbb5fb85cf48757a18870aaeedf6936d5c1f1ead (patch)
tree978874d324aec9f91309ca012fe637ccd60e0564 /drivers/platform/chrome
parent8dab6a5939199a5dcf0731eb2dce757837575633 (diff)
downloadlinux-bbb5fb85cf48757a18870aaeedf6936d5c1f1ead.tar.bz2
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: 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
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r--drivers/platform/chrome/cros_typec_switch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c
index 383daf2c66b7..3381d842c307 100644
--- a/drivers/platform/chrome/cros_typec_switch.c
+++ b/drivers/platform/chrome/cros_typec_switch.c
@@ -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;