From: Liao Yuanhong Date: Thu, 28 Aug 2025 12:27:37 +0000 (+0800) Subject: regulator: core: Remove redundant ternary operators X-Git-Tag: v6.18-rc1~166^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=899fb38dd76dd3ede425bbaf8a96d390180a5d1c;p=thirdparty%2Flinux.git regulator: core: Remove redundant ternary operators For ternary operators in the form of "a ? true : false", if 'a' itself returns a boolean result, the ternary operator can be omitted. Remove redundant ternary operators to clean up the code. Signed-off-by: Liao Yuanhong Message-ID: <20250828122737.43488-1-liaoyuanhong@vivo.com> Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 554d83c4af0c1..dd7b10e768c06 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1586,8 +1586,8 @@ static int set_machine_constraints(struct regulator_dev *rdev) } if (rdev->constraints->active_discharge && ops->set_active_discharge) { - bool ad_state = (rdev->constraints->active_discharge == - REGULATOR_ACTIVE_DISCHARGE_ENABLE) ? true : false; + bool ad_state = rdev->constraints->active_discharge == + REGULATOR_ACTIVE_DISCHARGE_ENABLE; ret = ops->set_active_discharge(rdev, ad_state); if (ret < 0) {