Unverified Commit 899fb38d authored by Liao Yuanhong's avatar Liao Yuanhong Committed by Mark Brown
Browse files

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: default avatarLiao Yuanhong <liaoyuanhong@vivo.com>
Message-ID: <20250828122737.43488-1-liaoyuanhong@vivo.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e2ab5f60
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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) {