Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Liao Yuanhong and committed by
Mark Brown
899fb38d e2ab5f60

+2 -2
+2 -2
drivers/regulator/core.c
··· 1586 1586 } 1587 1587 1588 1588 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; 1591 1591 1592 1592 ret = ops->set_active_discharge(rdev, ad_state); 1593 1593 if (ret < 0) {