Skip to content

Commit 899fb38

Browse files
LiaoYuanhong-vivobroonie
authored andcommitted
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>
1 parent e2ab5f6 commit 899fb38

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/regulator/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,8 +1586,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)
15861586
}
15871587

15881588
if (rdev->constraints->active_discharge && ops->set_active_discharge) {
1589-
bool ad_state = (rdev->constraints->active_discharge ==
1590-
REGULATOR_ACTIVE_DISCHARGE_ENABLE) ? true : false;
1589+
bool ad_state = rdev->constraints->active_discharge ==
1590+
REGULATOR_ACTIVE_DISCHARGE_ENABLE;
15911591

15921592
ret = ops->set_active_discharge(rdev, ad_state);
15931593
if (ret < 0) {

0 commit comments

Comments
 (0)