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 <liaoyuanhong@vivo.com>
Message-ID: <20250828122737.43488-1-liaoyuanhong@vivo.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
pull/1354/merge
Liao Yuanhong 2025-08-28 20:27:37 +08:00 committed by Mark Brown
parent e2ab5f600b
commit 899fb38dd7
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 2 deletions

View File

@ -1586,8 +1586,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)
} }
if (rdev->constraints->active_discharge && ops->set_active_discharge) { if (rdev->constraints->active_discharge && ops->set_active_discharge) {
bool ad_state = (rdev->constraints->active_discharge == bool ad_state = rdev->constraints->active_discharge ==
REGULATOR_ACTIVE_DISCHARGE_ENABLE) ? true : false; REGULATOR_ACTIVE_DISCHARGE_ENABLE;
ret = ops->set_active_discharge(rdev, ad_state); ret = ops->set_active_discharge(rdev, ad_state);
if (ret < 0) { if (ret < 0) {