From: Stephen Boyd Date: Tue, 30 Aug 2022 22:58:29 +0000 (-0700) Subject: platform/chrome: cros_typec_switch: Remove impossible condition X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bbb5fb85cf48757a18870aaeedf6936d5c1f1ead;p=linux.git 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 Cc: Tzung-Bi Shih Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220830225831.2362403-3-swboyd@chromium.org --- diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c index 383daf2c66b7c..3381d842c307b 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;