Unverified Commit b2369725 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Stephen Boyd
Browse files

clk: Simplify clk_is_match()



Linux style is to handle early-on failure.  Inverting the first
condition lets us simplify the second, and improves readability.

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarBrian Masney <bmasney@redhat.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 5d6c4776
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -3259,11 +3259,10 @@ bool clk_is_match(const struct clk *p, const struct clk *q)
		return true;

	/* true if clk->core pointers match. Avoid dereferencing garbage */
	if (!IS_ERR_OR_NULL(p) && !IS_ERR_OR_NULL(q))
		if (p->core == q->core)
			return true;

	if (IS_ERR_OR_NULL(p) || IS_ERR_OR_NULL(q))
		return false;

	return p->core == q->core;
}
EXPORT_SYMBOL_GPL(clk_is_match);